Skip to content

Tag: reactjs

Why is my useEffect function called only once?

I am rendering a list of Trips objects inside a FlatList. So I have a screen named Network where I have FlatList which represents each of the trips. My render method: Inside my Trip component is the trip information. Trip’s name AND trip’s geo locations. From those geolocations I want to get the t…

cant change the backgroud after updating the hook

i have a hook that holds number (as index) and array of images: i made two buttons that hold onClick event that should change the background to another image (by index): and the functions: by this the hook (currentIndex) should change and display the next image but its not working. what am i missing? this is …