in my parent component have an API call using fetch which gathers data that then passes to a child component to be displayed. The issue I am having is that it is rendering before the data is gathered and passed through props.
// PARENT COMPONENT
const [weatherData, setWeatherData] = useState({})
useEffect(function() {
const apiKey = ""
const url = `https://api.openweathermap.org/data/2.5/weather?
q=manchester&units=metric&appid=${apiKey}`
fetch(url)
.then(res => res.json())
.then(data => setWeatherData(data))
}, [])
// Passing the data through props to child component
<CurrentWeather weather={weatherData} />