Looking for reliable answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Explore thousands of questions and answers from a knowledgeable community of experts ready to help you find solutions. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.

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