1this.setState(prevState => ({
2 myArray: [...prevState.myArray, "new value"]
3}))
4
1this.setState(prevState => ({
2 myArray: ["new value", ...prevState.myArray]
3}))
4
1this.setState(prevState => ({
2 myArray: [...prevState.myArray, {"name": "object"}]
3}))
4
1this.setState(prevState => ({
2 myArray: [ {"name": "object"}, ...prevState.myArray]
3}))
4