Get the answers you need at Westonci.ca, where our expert community is dedicated to providing you with accurate information. Join our platform to connect with experts ready to provide detailed answers to your questions in various areas. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.

Why is my use effect not working react native.

Sagot :

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