Submitted almost 3 years ago
Responsive landing page using ReactJS and Styled-Components
@Andreeesc
Design comparison
SolutionDesign
Solution retrospective
I can't get the region filter to work properly, can someone help me find the solution?
Community feedback
- @b-a-merrittPosted almost 3 years ago
Hey!
The filter feature is a little tricky. The reason why yours is having issues is because it's not rendering the results after selection. You need a useEffect() hook that induces a re-render with your query state in the dependency array.
Also, I think it would be better if you saved the country data into a variable, then filtered the results into another variable that you then passed to your Components, instead of fetching the data with each new query.
Anyway, good job and happy coding!
Marked as helpful0
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