Q26: What is Automatic Batching in React 18?
Automatic batching groups multiple state updates together into a single re-render for better performance. React 18 automatically batches updates inside event handlers, promises, setTimeout, and native event handlers.
Key Takeaways
Groups multiple state updates into single re-renders to eliminate extra renders.
React 18 extends automatic batching everywhere (promises, timers, native handlers).
Knowledge Check
How can you opt out of automatic batching in React 18 if immediate render is needed?