Greetings,
I came across this call and don't understand how it works, which concept is behind?
const todos = [...this.state.todos, todo]
this.setState({todos, inputValue:''}, () => { console.log(this.state)})
I was expecting
this.setState({todos: todos, inputValue:''}, () => { console.log(this.state)})
Thank you.