Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

React Countries & Weather API with color theme switcher

fetch, node, react, react-router, styled-components
Travolgi 🍕•31,260
@denielden
A solution to the REST Countries API with color theme switcher challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi there :)

I had a lot of fun in this challenge and had a good opportunity to learn how to use Router v6 and Styled Components for the first time.

Also I practiced a lot with React custom hooks, initially I had some problems in the details page because React didn't update the page content because I rightly didn't set the listening on the parameter that changed.

Also I added some additional features:

  • See current country weather data on detail page through other API
  • See the Map of the country on the details page
  • Button scroll to top after the scrool
  • Button for query reset when typing on the search input
  • Error page with animated svg when no results found
  • LocalStorage save of the set light or dark mode theme

But...

  • Despite my extensive research I still have to figure out how I can create a preload at render time while react builds the page so that the "hops" due to reset.css are not seen as soon as the app is opened.
  • I also want to understand how to show an upload on the single image as it is uploaded.

Thank you for taking the time to check out my project! And Happy coding ;)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Travolgi 🍕's solution.

Join 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License