1how to add array data on state react
2this.setState({ myArray: [...this.state.myArray, 'new value'] }) //simple value
3this.setState({ myArray: [...this.state.myArray, ...[1,2,3] ] }) //another array
1this.setState(prevState => ({
2 arrayvar: [...prevState.arrayvar, newelement]
3}))
4