I am trying to check my todo list and change the status but I cannot figure out what's wrong.
Here is my code:
handleChange = (id) => {
let data = [...this.state.data];
let indexOfTodo = data.findIndex(todo => todo.id === id);
data[indexOfTodo].checked = !data[indexOfTodo].checked;
console.log(data[indexOfTodo]);
console.log(data)
}
I hit the button twice and here is the console.log
Sorry for dummy question. I am new in react
