Masan1489 Masan1489
  • 02-12-2021
  • Computers and Technology
contestada

Why is my use effect not working react native.

Respuesta :

spiderman71
spiderman71 spiderman71
  • 02-12-2021

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

Answer Link

Otras preguntas

Can anyone please help me ?
During their lastest visit to the eye doctor, Ebony and Chelsea got their eyes checked.Ebony's vision: Left eye: -1.50 Right eye: opposite numberChelsea's visi
help me with all of them im lazy and i wanna get over with this thanks! ;) :) :}
Help me plzzzzzzzzzzzzzzzzsss
A punch recipe for 24 people uses 4 liters of Soda, 2 pints of sherbet, and 6 cups of Ice. How much of each ingredient would you need to make an identical recip
my worst vacation essay
Why are some numbers written in scientific notation?
a wheel that has teeth that fits into another wheel is
A 2kg object is moving horizontally with a speed of 4 m/s. How much net force is required to keep the object moving at this speed and in this direction
in the bakery, a container of cookies is $4.55 and contains 13 servings. divide the coins into 13 equal groups to determine the cost per serving.