IDNLearn.com: Your destination for reliable and timely answers to any question. Our platform provides accurate, detailed responses to help you navigate any topic with ease.
The reason this happens is because the api call is asynchronus, it doesn't populate the state immediately, so the render happens first and tries to read current from the initial weather state null in the render method make sure not to read weather