Relative Content

Tag Archive for javascriptreactjsarraysreact-hooks

How to reset my useState to it’s initial state after filtered list has rendered?

I am having trouble figuring out how to reset my projectList to it’s initial state so that way in the filterProjects function it is filtering through the entire projectList and not the already filtered ones. I have a function called resetProjects, just not sure where to call it so that the displayProject function works as it should.

How to render an array of objects with a child component in react?

I’m new to learning react and passing props to child components is still confusing to me.
I passed an array of objects from express server to react app with axios, the react app first uses .stringify() and then uses .parse() and then i updated the state variable
enter image description here

Updating array of objects (state) based on previous state

I have an array of objects that is being built through the UI. Let’s say each object is displayed as a card. I am also giving the user the ability edit each object (card). I am thinking the best way to update the array is based on the previous state.