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

From midnight to 6:00 am, the temperature rose 8*C.At 6:00 am, the temperature was -20*C.What was the temperature at midnight?
Zoomed Into And Through The University.What Figures Of Speech Is This Expression And What Does It Mean?
What is the value of sin(x) when x = 30°? negative one-half one-half 1 -1
The length of a rectangle is 45 in and is dilated to 15 in. What is the scale factor? 1/3 3 -3 - 1/3
The temperature in bloomington on sunday was 32.6° c. on monday, the temperature changed by -8.25° c. what was the temperature on monday?
Which direction does air circulate into low pressure zones in the northern and southern hemispheres
About how long does water vapor remain in the air
Which of the following is not characteristic of the public health model
Why were europeans motivated to and begin exploring the world?
Can someone please check my answers? (<---- = my answer) Read the following description of a character and check what you think the person is like (Mark all