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

List two common objects for where the natural origin is a metal and two common objects for which the natural origin is a nonmetal
If you can buy 4⁄5 of a pound of ham for 3 dollars, how much can you purchase for 10 dollars? Write your answer as a fraction of a pound.
Why is it helpful to set a purpose for reading?
An actor is expected to take care of his body and as such is expected to
You track the temperature from the time you eat lunch to the time you go to bed. You find that it drops 4 degrees each hour for 8 hours. which expression best s
What was the effect of rotten boroughs on the democratic process in England?
Which change of state involves a release of energy? a) boiling c) condensation d) melting e) sublimation
Which of the following best explains the fact that eyebrows do not grow as long as the hair on the head?
What are some good realistic fiction books for middle schoolers? I have to read four for school and I have no clue.
Which best describes the items listed here? bifocal glasses efficient stove fire department Poor Richard's Almanack