Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Rest countries API with theme switcher

Matheus 240

@MatheusVSN

Desktop design screenshot for the REST Countries API with color theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
4advanced
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello world🤗, this is my solution for the challenge Rest countries API with theme switcher

What did you find difficult while building the project?

  • The most difficult part for me was the routing part. As I've never experimented with that, I had a lot of trouble building it

Wich areas of your code are you unsure of?

  • None, but feedbacks are always welcome if you find something that isn't a good practice

Do you have any questions about best practices?

  • None

Community feedback

Maxence 170

@MaeWolff

Posted

Hi Matheus!

I've identified a few things to improve:

  • Your custom hook CallCountriesAPI should be named with the prefix use (so useCountries for example) to respect the convention rules and allow the linter to check if you are using the hook according to the rules of the react hooks
  • You can type your states in the following way: const [state, setState] = useState<YOUR_TYPE_HERE>(defaultValue)
  • Avoid using the type any, maybe use unknown or create the real types

Congrats on your post :)

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

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