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

Sylwia Vargas
JavaScript in Plain English
2 min readFeb 3, 2020

--

“Red and Blue Pelikan Br 40 Eraser on White Surface” by Pixabay

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}
]
}

--

--