Vigyata.AI
Is this your channel?

React 19 Tutorial - 25 - useState with Arrays

5.2K views· 181 likes· 8:52· Dec 1, 2025

🛍️ Products Mentioned (2)

Github - https://github.com/gopinav/React-19-Tutorials Become a Fullstack Developer with Scrimba - https://scrimba.com/fullstack-path-c0fullstack?via=Codevolution Follow me + Twitter - https://twitter.com/CodevolutionWeb Business - codevolution.business@gmail.com useState with Arrays in React 19

About This Video

In this React 19 lesson, I switch gears from objects in state to collections of data—arrays. I build a simple to-do list component where I keep an array of items in state, each item being an object with an id and text. Then I render the list using map and make sure every list item has a proper key prop, because that’s non-negotiable when you’re rendering lists in React. I also add a quick console.log so you can see exactly when the component rerenders as state changes. From there, I walk you through the three most common array operations in React state: add, delete, and update. For adding, I show why items.push doesn’t work (it mutates the array and React won’t rerender) and instead use the spread operator—or concat—to create a brand new array for setItems. For deleting, I use filter to return a new array without the selected item. And for updating, I add a done flag and use map to immutably toggle done for the matching item. The key takeaway is simple: treat arrays in state like objects—never mutate, always create a new array so React stays fast and predictable.

Frequently Asked Questions

🎬 More from Codevolution