How React Works · Part 047 min read
State Updates: Snapshots and Batching
Each render sees a fixed snapshot of state; calling a setter queues an update instead of changing a variable, and React batches every update from one event into a single render that runs after your handler returns.