I have this state in my class:
this.state = {
inputValue: "",
todos: []
}
In an arrow function, I am trying to setState in order to put inputValue into todos.
this.setState({ inputValue: "", todos: [...this.state.todos, {this.state.todos.length: this.state.inputValue}] })
However, when I try to insert the inputValue and the number, it gives an error. Any help is appreciated as I am new to React.