REST countries using React & Tailwind-CSS, built with Vite
Design comparison
Solution retrospective
This was the toughest challenge so far and it helped me understand React a bit better. There's still a lot to learn about routing and loading items synchronously! Often, I was getting an error "can't do function on undefined", because my JSX wanted to load before the items were downloaded from the API, so it would load NULL or undefined! I made a few workarounds for it, but I believe it can be done much better.
This was also my first project in Tailwind-CSS. It's quite handy and really quick to figure out. Their documentation is great.
One design choice I gave up on was simply downloading all countries once and then just filtering them based on different properties. I did not do this because https://restcountries.com already gives us methods for filtering. Was this a good choice?
A small thing people may or may not notice is that links to border countries are actually country codes and those always return 1 object, not an array. I was getting burned out, so I did not finish making a better solution.
What are the best ways to compartmentalize a React project? I am not sure! How many folders should I have and for what purposes?
All constructive feedback is appreciated.
Community feedback
Please log in to post a comment
Log in with GitHubJoin 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