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

Help me out please❗️❗️
Solve |2x-5|= 4Need in 5 minutes ​
uesday Write 784,000 in each form, Word: Expanded
true false or not enough information??
In your own words, identify the main idea of the following paragraph, at provide at least one supporting detail which supports that main idea: She grieved inces
Identify the irrational sum(s). Select all that apply. (more than 1 answer A) √9+ √7 B) 10+ π C) √16+1/2 D) 2.25+6
What structure is highlighted? A. Conus elasticus with mucosa B. Vocal fold c Inferior horn of thyroid cartilage D. Superior horn of thyroid cartilage E. Vestib
Long-term savings strategies include: A. opening up a low-interest savings account. B. setting aside money for an emergency. C. making a household budget each m
Where do American Indians live today? Can someone please tell me
Read the scenarios given below. Analyze each scenario and then write briefly on how you will apply your resourcefulness to overcome the problems in the scenario