@HusseinSamy
Posted
Hello @KevinPadi, 👋🏻
Awesome job on taking the first steps towards your dream!
** Actually, I like your solution more than the design 😆. I have some slight recommendations for you:**
1.Show an error message if the client failed to fetch the data:
const getCountries = () => {
useEffect(() => {
fetch('https://restcountries.com/v3.1/all?fields=name,flags,tld,currencies,capital,region,subregion,languages,borders,population')
.then(response => response.json())
.then(data => {
setData(data)
})
.catch(error => {
==== In the next line, you can use alert() instead of console.error() to let the user know what happened.
console.error('Hubo un error al obtener los datos:', error)
})
}, [])
}
2.I don't know what the user will see in case the countries didn't come back, but if you handled, great job! ✨
3.Add meta tags:
<meta name="title" content="My Website">
<meta name="description" content="My Website Description">
<meta name="keywords" content="Some, Keywords, Here">
Hope you find it useful!😇
Keep up the fantastic work, and happy coding! 🚀
Marked as helpful
@KevinPadi
Posted
Hey @HusseinSamy ! 👋🏻
Thanks a bunch for checking out my solution and for the awesome feedback! 🚀 I really appreciate your encouragement. Happy coding to you too, mate! 👨💻