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 Using React

#react
Anas 330

@redshift14

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


Had fun doing this challenge, I am still at the beginning journey with React so any suggestion or feedback is appreciated!

Community feedback

@lipe11

Posted

Hi, nice solution!. I'm currently working on this project myself.

I think your react code is very clean, if you're just starting, you're definitely on the right track.. And adding the map was a nice touch too!

Just a couple of small suggestions:

  • consider putting your fetch functions into a module, and import them from your components.

  • instead of using the regex for the comma separated list, you could use

array.join(', ')

Marked as helpful

1

@lipe11

Posted

sorry, I think the regex wasn't for the comma separated list, but for the population... in that case number.toLocaleString() does the trick.

Marked as helpful

0
Anas 330

@redshift14

Posted

@lipe11 Thanks a lot for your feedback. I think putting fetch functions in a separate module is a good idea, and you are right using toLocaleString() is better than using regex I will modify it too.

0

@Duyen-codes

Posted

Nice job on completing this one! I’ve just started learning react and this project is on my goal list too.

1

Anas 330

@redshift14

Posted

@Duyen-codes Thanks for your feedback, and good luck for you

0

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