Fetch request returns Promise

Hey ,

I got a country page with links to border countries , now are the border country names not the full country name so I need to make a fetch request for the full name
but when I do the result becomes a Promise (see picture 1)

How can I access this value?


I tried to fix this with .then it gives me the correct data. But then I can't put the data inside my component (see image 2 example 2)
getBorderCountryName() fetches the URL of the API

GitHub code : https://github.com/Jenskiii/countriesApi-dec2023-react
live site : https://countries-api-dec2023-react.vercel.app/countries/MK
GitHub
Contribute to Jenskiii/countriesApi-dec2023-react development by creating an account on GitHub.
GitHub - Jenskiii/countriesApi-dec2023-react
Was this page helpful?