Countries list using HTML, CSS and JavaScript

Solution retrospective
I have not written the code for the filter function. I need help with that.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @jyotirmoy-sinhababu
I have used
const handleRegionChange = async (region) => { try { await axios .get(`https://restcountries.com/v3.1/region/${region}`) .then((res) => { if (res.status == 200) { setDataByRegion(res.data); } if (res.status != 200) { setIsErr(false); } }); } catch (err) { console.log(err); } };
as a filter function, where each region is a button and selecting the button will call the function with the selected region as an argument.For style I think you have used flex and flex-wrap, just reduced the gap between cards and increase the width of the cards , I think in that way it will look better.
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