push list of id to state from array in react code example
Example: push values to state array class react
this.setState(prevState => ({
arrayvar: [...prevState.arrayvar, newelement]
}))
this.setState(prevState => ({
arrayvar: [...prevState.arrayvar, newelement]
}))