i have a state(array of object) which is as follows:
const [state,setstate]=useState({picture:'',name:'',job:''})
and i have 3 inputs in Front-end side which get picture,name,job... i define an array to save a collection of objects (consisting of picture,name and job of each person) as follows:
var colllection=[]
i use collection.push({state}) , but it overrides collection and does not add new state to end of the mentioned array.any idea?
var collectionsplaced incorrectly and always reinitialized. 2) look at variable name - it contains 3lDo Not Modify State DirectlyPlease go through the documentation one. here; reactjs.org/docs/…