1this.setState({ myArray: [...this.state.myArray, 'new value'] }) //simple value
2this.setState({ myArray: [...this.state.myArray, ...[1,2,3] ] }) //another array
3
1const handleAdd = (todo) => {
2 const newTodos = [...todos];
3 newTodos.push(todo);
4 setTodos(newTodos);
5}
6