this is the main problem:
: decodeURI(`https://disease.sh/v3/covid-19/countries/${countryCode}`);
in console i get this:
App.js:59 GET https://disease.sh/v3/covid-19/countries%E2%80%8B/AI 404
the url somehow changes only upon doing the fetch(url), the countryCode when i console.log seems fine
there are these random letters %E2%80%8B inside the url that i dont want how do i remove it?
const onCountryChange = async (event) => {
const countryCode = event.target.value;
console.log('country info', countryCode)
const url = countryCode === 'worldwide' ? "https://disease.sh/v3/covid-19/all" : decodeURI(`https://disease.sh/v3/covid-19/countries/${countryCode}`);
await fetch(url)
.then(response => response.json())
.then(data => {
setCountry(countryCode);
setCountryInfo(data);
})
};