Vigyata.AI
Is this your channel?

React 19 Tutorial - 23 - How React Batches Updates

5.5K views· 182 likes· 4:04· Nov 26, 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 How React Batches Updates

About This Video

In this React 19 lesson, I answer a question that trips up a lot of people: why does React render only once even when you call setState multiple times in the same event handler? In the previous video we called setCount three times, and you’d expect three renders. To make it really obvious, I build a new component called BatchingCounter and add more state: count, name, and isActive. Then in a single handleClick, I update count three times (with updater functions), update name once, and set isActive to true. Now here’s the interesting part: if every setState caused an immediate re-render, we should see “render phase component rendering” five times in the console. But when I click the button, React renders only once (the double log you might see is just Strict Mode). That’s batching. React waits for your event handler to finish, collects all the state updates, and applies them together in a single render. The restaurant waiter analogy fits perfectly: the waiter doesn’t run to the kitchen after every dish—you place the full order, then it goes in one shot. The takeaway is simple: state updates follow predictable rules, and batching is one of React’s smartest optimizations to keep your UI fast.

Frequently Asked Questions

🎬 More from Codevolution