how to replace value in array at state in 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]
}))