how to push a item to a array that is an property of an object in a state with array of objects react code example
Example: how to update array in react state
this.setState(prevState => ({
arrayvar: [...prevState.arrayvar, newelement]
}))
this.setState(prevState => ({
arrayvar: [...prevState.arrayvar, newelement]
}))