Updating a value in a nested array of objects in React
How to update just one value in an array of objects in a state
Published in
2 min readFeb 3, 2020
Say we have a component with an array of to-do’s, just like this:
state = {
todos: [
{id: 1,
title: "Eat breakfast",
completed: false},
{id: 2,
title: "Make bed",
completed: false}
]
}