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

you shoot a model rocket into the air with a speed of 18.2 m/s. now high does the rocket go?
Which of the following is the equation of a line parallel to the line y=3x+2, passing through the point (10,1)? A. 3x - y=29 B. 3x + y=29 C. -3x - y=29 D. 3x +
what does the numerator tell us in fraction
Which statement accurately describes the Battle of Marathon?   A. Athens fought alone against Darius's army and decisively defeated the Pers
What Is the Richest Country in the World?
Ryker is given the graph of the function y= 1/2x^2 - 4 . He wants to find the zeros of the function but is unable to read them exactly from the graph. Find the
What is social Darwinism and how was it tied to imperialism?
what muscles are involved when you're tying your shoe laces
Solve for x/4-x+2/6=x/3
Rheumatic fever is a bacterial disease that can result in degeneration of heart valves that would cause?