djekokma,
макет здесь может не сработать, но примерно так
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.25.0/babel.min.js"></script>
<script type="text/babel">
function Example() {
const [data, dataSet] = React.useState(null)
React.useEffect(() => {
async function fetchMyAPI() {
let response = await fetch('https://api.openweathermap.org/data/2.5/forecast?q=London&&appid=47f0bb1e397d9c96b56ba33f697a4ea5')
response = await response.json()
dataSet(response)
}
fetchMyAPI()
}, [])
if (data === null) {
return 'Загрузка...';
}
const {list} = data;
const now = list[0].main;
const{temp, feels_like, temp_min, temp_max, pressure, sea_level, grnd_level, humidity, temp_kf} = now;
return <div>feels_like : {feels_like}</div>
}
ReactDOM.render(<Example />, document.getElementById("root"))
</script>
</body>
</html>