Sep 6, 2018 · 1 min read
Ya totally, you can update state with setState, but you try not to mutate state. For example something like:
const updatedTodos = [...this.state.todos, newTodo]
this.setState({ todos: updatedTodos })as opposed to:
this.state.todos.push(newTodo)
this.setState({ todos: this.state.todos })