Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

REST countries api with theme switcher using react and scss module

fetch, react, react-router, sass/scss, vite
Ezeh Chijioke•170
@Ezeh20
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


What did you find difficult while building the project?

  • I had problems when I tried to render the filtered result. The initial state of my filtered state is an empty array before it is been populated with data items based on the user's search or filtered term which caused errors when i tried to map the array, after going through some online posts i figured out that an array can only be mapped if true so i used the short circuit && operator to map out the items if my array is true.

  • I also had a little problem when working with the api v3 but it all turned out fine.

Which areas of your code are you unsure of ?

  • I'm not particularly sure of how I handled the routing.

Do you have any questions about best practices?

  • Of all the questions I need to ask, i feel app optimization, propTypes and testing tops the list. for optimization, i noticed some of my components rerenders when they don't need to.

FeedBack

Reviewers should please drop criticisms if need be, particularly on the search and filter feature

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 Ezeh Chijioke'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 - 2026
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License