react set state add new value code example
Example 1: add new array at the back of react state
this.setState(prevState => ({
myArray: ["new value", ...prevState.myArray]
}))
Example 2: reactjs update state example
{
hasBeenClicked: false,
currentTheme: 'blue',
}