Skip to content
Advertisement

Tag: react-props

Save a prop when moving away and coming back to page ReactJS

I have a username property that I have passed on from “log in” route to “product list” route using I then have a <Link to={‘/products/${product.id}’}>More info</Link> that sends me from “product list” to an “individual product”. When I then come back to the “product list” <Link to={‘/products’}>Back</Link>, the username is gone. Is there a way to keep the username, so

How do I stop state element being passed to child component before it is set?

I’m writing a weather forecast app with React. I’m fetching the data from openweathermap.org API. But to use that I need to know user’s location. So I use other API’s in sequence as well to identify user IP, location, and then weather data according to that location. At each fetching state I update the initial states with information fetched. For

Advertisement