'How to access Weather API icon id?
Same situation as in this How to display openweathermap weather icon
Why I cannot get an id for icon, with this code ?
const value = weather.weather
console.log('icon', value)
console.log('icon', value[0].icon)
const url = `http://openweathermap.org/img/${value[0].icon}.png`
return(
<div>
<div> temperature {weather?.main?.temp} Celcius</div>
<img src='url' alt="icon" width="120" height="100"></img>
<p>wind {weather?.wind?.speed} m/s</p>
</div>
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
