import React, { useEffect, useState } from 'react'; const WeatherList = () => { const [weatherArray, setWeatherArray] = useState([]); const [weatherArrayAfterFilter, setWeatherArrayAfterFilter] = useState([]); useEffect(()=>{ fetch('https://danepubliczne.imgw.pl/api/data/synop/') .then(resp=>resp.json()) .then(weather=>{ setWeatherArray(weather); setWeatherArrayAfterFilter(weather); }); }, []); let weatherBoxes = weatherArrayAfterFilter.map(cityWeather=>{ return (
{cityWeather.temperatura} st. C.
{cityWeather.cisnienie} hPa