I make an api call , check the data to make sure it's there but for some reason my array that it return is empty.
export const fetchFiveDayWeather = (lat, lon) => {
axios.get(
`http://api.openweathermap.org/data/2.5/weather?
lat=${lat}&lon=${lon}&APPID=${apiKey}&units=metric`
)
.then((response) => {
console.log(response.data)
return response.data
});
}
Code of the function: