Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Rest Countries API ,Vite, React and tailwind css , with theme switch

react, react-router, tailwind-css, axios
Raza Abbas•770
@RazaAbbas62
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


Any feedback or criticism is welcome.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Petrit Nuredini•2,860
    @petritnuredini
    Posted over 1 year ago

    Congratulations on completing your React project! It's great to see your hard work and effort. Here are a few suggestions to further enhance your project:

    1. Error Handling and User Feedback:

      • Implement error handling in your API calls. For instance, in CountryDetail, handle errors gracefully and inform the user if there's an issue fetching data. This improves user experience. You can learn more about error handling in React from Error Handling in React 16.
    2. Optimizing Performance:

      • Consider using React.memo or useMemo to prevent unnecessary re-renders, especially in components like CountryData where you are processing data. It's essential for larger applications. Check out React.memo for Functional Components Rendering Control.
    3. Code Structuring and Readability:

      • It's good practice to split large components into smaller, reusable ones. This not only makes your code more readable but also easier to maintain. For example, in CountryData, you could create separate components for displaying country details and border countries. Learn more about component composition in React here.

    Keep up the excellent work! Remember, every project you complete brings new learning opportunities and experiences. Stay curious and keep exploring the vast world of React! 🌟🚀

    Marked as helpful
  • alexander•1,300
    @alex931d
    Posted over 1 year ago

    hello FAZEEN IJAZ great project overall but i notice quite a few mistakes something you must have notice

    1. the dropdown menu when its active the menu is not aligned with the dropdown select and is far down the screen 2.on larger screens it would be nice to have an limit for the maximum amount of cards showen on the screen since there is far too many
    2. Population Decimal separator you can achive this using Regular expressions
    3. change of dark mode label to light mode when changing
    4. website crashing when rendering Antarctica i had same problem since antarcica has no borders and no offical language and currency

    next time building a larger project i reccoment you to test your website and build a finish product

    Marked as helpful
  • Theunis•210
    @theYuun
    Posted over 1 year ago

    Alexander did mention the filter by region alignment issue, but I also found that if you move your mouse straight down from the button to the dropdown list, you pass over the flag below the button and you hover over that flag, thereby also placing that flag over the dropdown list. Consider using z-index liberally, like z-index: 9999;, to avoid such issues in the future.

    Also allow your app to treat a dropdown like a modal, ensuring that other interactive elements do not steal focus from targeted elements. A cool way to do this is by adding a transparent div with a lower z-index below the dropdown that spans the screen and blocks mouse interactivity with anything lower down the z-order. A great alternative to using this input-blocking div is playing around with the event.stopPropagation(); function available to Javascript.

    Otherwise, amazing work!

    Marked as helpful

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

Oops! 😬

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

Log in with GitHub