Design comparison
Solution retrospective
Hi,
This is my solution to this challenge! It was a fun challenge, and I learned a lot about Context API and useReducer hook.
Any feedbacks are welcome! Happy coding and have a nice day!
Community feedback
- @vatsalsinghkvPosted over 2 years ago
It's nice but it's slow like while searching for a country. How'd you manage to get border countries name
0@sqle157Posted over 2 years ago@vatsalsinghkv Hi, thank you for your feedback!
The searching depends on the fetch request so I'm not sure if I can speed that up. For the border name, I used the api endpoint where you can fetch country by country code and return the name of the country according to that border code.
I hope this answers your question!
0@vatsalsinghkvPosted over 2 years ago@sqle157 well I faced the same challenge so to speed up I fetched every country data and while searching for it I didn't make and http request and even when country is visited. Thanks I really liked your idea of getting border names but wouldn't that make your app slow?
0@sqle157Posted over 2 years ago@vatsalsinghkv It would, but to make up for it, I make a Spinner so it will appear to be loading for data everytime you visit the country detail page.
It will increase the user experience and doesn’t make the app looks slow. When users use the app, the spinner will give them the feel that the app is loading, not just some instant view of the page.
In the end, it depends on how you handle the challenge and how to make the UX better with your solution.
I know my solution is not the most appropriate one, but I hope this can give you some inspiration on coding this challenge.
0
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