Submitted about 3 years ago
REST Countries API with color theme switcher using React
@Dyios
Design comparison
SolutionDesign
Community feedback
- @pavelangonPosted about 3 years ago
I see you also encountered an issue I'm currently working on solving which is once routed to the details page and you refresh, it clears the state of the selected country. Let me know if you ever get to a working solution on my solution post please.
0@DyiosPosted about 3 years ago@HttpsPal Hi, i think there are three solutions for this:
- make an api call to retrieve the data again, it's the easiest for this challange. but if you are in a project that don't use an api and need to preserve the state you can either:
- store the data in localStorage,.
- use redux (librery), it's the best way to handle the state if you have a big app so you don't need to manually track and store it.
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