React · Middle · Question 25 of 75
What is automatic batching in React 18+?
- ✓Correct answer: Combining multiple
setStatecalls into one render everywhere - 2Combining multiple components into one JS bundle
- 3Automatic memoization of all components in the app
Explanation
Before React 18, updates were batched only in React event handlers. Now setA(); setB(); inside setTimeout, fetch().then() or native handlers produce one render. If you need to apply an update synchronously (e.g. before measuring the DOM), use flushSync.