double buffering
Keeping two copies of something, one on screen and one being prepared, then swapping them when the new one is ready.
In more detail
React keeps a current fiber tree matching the screen and builds a workInProgress tree off-screen during rendering. When the work is finished and committed, a pointer swap makes the new tree current and the old one becomes the alternate for next time. Unfinished work never shows on screen.
Related terms
- Fiber — The internal object React keeps for each component instance, and the name of the React 16+ engine built on those objects.
- commit phase — The part of an update where React applies the calculated changes to the real DOM, all at once and without interruption.
- render phase — The part of an update where React calls your components and compares the results with the previous tree, without touching the page.
Taught in
- React Fiber Architecture: Work Units, Priority And Commits — React 19 & Modern Component Architecture