Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 11 months ago

My Rest Countries API React App

react, tailwind-css, react-router
Aecio Neto•340
@aecio-neto
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 are you most proud of, and what would you do differently next time?

I'm proud of showing up daily and doing the work, over and over again. The programming thing? I got hands-on experience with handling API requests, setting up a React routing system, and solving bugs. I ended up writing some spaghetti code, but you know what? It works! The code isn't perfect, but today I'm better than yesterday.

What challenges did you encounter, and how did you overcome them?

I need to improve:

  • Error handling to enhance user experience
  • Optimize API Calls
  • Refactor and keep things separate (logic and UI) and get a better readability.
What specific areas of your project would you like help with?

The routing system. Does a better way to do this? Do I need to break things apart (CountryPage)? (separate my code into reusable parts?)

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Abdelwahab•150
    @Abdelwahab121221
    Posted 11 months ago

    You can use the png photos instead of svg photos to make all card the same height

  • Teodor Jenkler•4,040
    @TedJenkler
    Posted 11 months ago

    Hi @aecio-neto,

    Nice project! I really like the creative use of the "X" on the search bar.

    Here are a few observations and suggestions for improvement:

    1. Grid vs. Flex: I noticed that you’re using Flexbox instead of Grid. As a best practice, use Grid when you want the cards or content controlled by the parent and maintain consistent sizes. Use Flexbox for more flexible layouts. This project is a good opportunity to practice CSS—use Grid for the first page and Flexbox for the second to see how each can be applied optimally. (Atm the first page isn't responsive see t.ex tablet size)

    2. Background Color Issue: When searching for one country, the background displays two colors. This might need some adjustment to ensure a consistent background throughout.

    3. Custom Select Enhancements: The custom select component would look even better with hover effects and animations. For example, consider rotating the image 180 degrees on hover.

    4. Border Buttons: Spend some time ensuring the border buttons work as intended. You can achieve this using React Router with the /:id parameter to dynamically set page content based on the ID. This is a valuable skill and a core aspect of React development. For more information on using React Router for dynamic routes, check out the React Router tutorial., (useParams() hook to get id and map out data)

    Overall, your project is coming along well, and these adjustments will help enhance its functionality and visual appeal.

    Hope this feedback is helpful!

    Best,
    Teodor

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub