React's Current & Work-in-Progress Trees

React uses a double-buffering technique for non-blocking updates. The current tree is what's on screen; the workInProgress tree is built in the background on state changes. The footgun is confusing this low-level mechanism with the 'virtual DOM'.
Why it exists
Before React 16, large component tree updates could block the main thread, freezing the UI and creating a poor user experience. The two-tree architecture was introduced with the Fiber reconciler to enable concurrent rendering, allowing React to work on updates in chunks and yield to the browser to handle higher-priority tasks like user input.
The mental model
Think of double-buffering in graphics or a stage crew setting up the next scene behind a closed curtain. The current tree is the scene the audience is watching (what's rendered on screen). The workInProgress tree is the new scene being built in the background. React can assemble this new scene piece by piece. Once the new scene is fully prepared, the 'curtain' swaps instantly, and the workInProgress scene becomes the new current scene.
How it works
On an initial render, React creates a tree of 'fiber nodes' that represents the UI state; this is the current tree. When an update is triggered (e.g., by setState), React does not mutate the current tree. Instead, it creates a clone of it called the workInProgress tree. The reconciliation algorithm then walks this workInProgress tree, computing the differences and scheduling side-effects. This work can be split into chunks and paused. After the entire workInProgress tree is processed, React enters the synchronous 'commit phase'. It applies the DOM updates and then atomically points the current pointer to the finished workInProgress tree, making it the new current tree for the next render cycle.
When to use it
This is an internal React mechanism, not a pattern you implement yourself. You automatically benefit from it in React 16+ whenever a component re-renders. Understanding it is key to grasping how concurrent features like useTransition work and for debugging complex performance issues.
When not to use it
You cannot opt out of this behavior. However, knowing its limitations is useful. While the reconciliation 'render phase' is async and pausable, the 'commit phase' (when DOM mutations happen) is synchronous. If the final DOM manipulation itself is very heavy, it can still cause jank, even with concurrent rendering.
One canonical example
In a simple counter app, the initial render creates a current tree with a button and a span showing '0'. When you click the button, React creates a workInProgress copy. It traverses this copy, finds the span, and marks it for a text update to '1'. Once the traversal is complete, React commits the change, updating the real DOM and swapping the workInProgress tree to become the new current tree.
Interview question
Which statement correctly describes the nature of React's update phases within its two-tree architecture?
- a.The reconciliation (render) phase is asynchronous and pausable, while the commit phase is synchronous.Correct
- b.Both phases are synchronous, but the workInProgress tree allows for background processing.
- c.Both the reconciliation (render) and commit phases are designed to be fully asynchronous and pausable.
- d.The reconciliation (render) phase is synchronous, but the commit phase can be paused and resumed.
Why? this is the answer
The card explicitly states that the reconciliation (render) phase "can be split into chunks and paused," making it asynchronous, while the "commit phase" is "synchronous." Option C is a tempting distractor because concurrent rendering emphasizes asynchronicity, but it incorrectly applies this to the commit phase.
Just read this? Test yourself on what you have been reading.
Read the original → blog.ag-grid.com
- #react
- #fiber
- #reconciliation
- #performance
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on react — each one lists the topics its interview covers.
See open roles