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

rest countries api, dark mode, random page, localstorage, nextjs

next, tailwind-css, react
Larry•170
@lawrence-yoon
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


I've built some custom hooks with the help of the internet, and I think I am getting the hang of it. Does anyone have any tips on creating robust custom hooks?

Also, I was in the process of creating a higher order debounce hook that takes a callback function, but I figured I did not actually need it for this project. However, I am still fascinated with the idea of passing a callback function into a function, and having it return a callback function. Does anyone have any good resources/tips for creating higher order functions in react/next?

Finally, I would like some advice or tips on refactoring code. Do you have any good resources/references on how to best refactor react code? I am slowly making my code a bit nicer to look at, but I still do not know the proper amount of abstraction.

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 Larry'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