@jesse10930
Posted
Hey Saumya, your project is looking good so far! In order to get the full name of the country rather than just the 3-letter country code, you have to find the country name that corresponds to the 3-letter country code from the API.
If I'm following your code correctly, you first store all the data for all the countries in the 'country' state when the home page loads. If you pass that state as a prop down to the CardDetails component, you can loop through this data to find the 'alpha3code' that matches the 3-letter country code for your border countries, and then return the 'name' from that country instead of the 3-letter code.
If you don't want to deal with props and React Router, you could fetch and store the data from 'https://restcountries.eu/rest/v2/all' each time the CardDetails component loads, but this would slow your app down quite a bit.
Hope this helps! Happy Coding!
@nikkuv
Posted
@jesse10930 Thank you so much for this :) I'm working on it.