
Design comparison
Solution retrospective
I'm most proud of creating a custom hook called useShorten, which handles all the necessary validation and error catching for the URL shortening functionality. This hook streamlined the logic, making the component code cleaner and easier to maintain. Additionally, I focused on building reusable components and ensuring the application was fully responsive across different devices. I also implemented a delete handler function with a delete button, allowing users to easily manage and remove shortened URLs. Leveraging tools like React Hooks helped me build an efficient, modern interface with minimal styling overhead.
What challenges did you encounter, and how did you overcome them?One of the biggest challenges I faced was dealing with CORS issues when making API requests. The external API I was using didn’t allow cross-origin requests, which initially blocked the app from fetching data correctly.
I explored different solutions like setting up a proxy during development with Vite and trying out CORS proxy services. Eventually, I opted for an API that provided proper authentication tokens and supported cross-origin requests, which made the integration smooth and secure. This experience improved my understanding of how CORS policies work and how to troubleshoot similar issues in the future.
What specific areas of your project would you like help with?Nothing really, but if anyone knows how to fix the original API CORS request, I'd be grateful.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord