How React renders · senior
Fiber: how React splits rendering into units of work
Fiber is React's internal rewrite of reconciliation: each component instance is a "fiber" object linked by child, sibling and return pointers, so React can do render work in small pieces, pause for urgent work, and throw away work it no longer needs.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- The old "stack" reconciler was recursive and synchronous: once a big render started it blocked the main thread until it finished.
- A fiber is a plain object per component instance: type, props, state and the hooks list (
memoizedState), effect flags, lanes (priority), and pointerschild,sibling,return, plusalternate. - Because the tree is a linked list, React walks it with a loop (begin work going down, complete work going up) and can stop between units and continue later. This is cooperative scheduling on ONE thread, not multithreading.
- Double buffering: React builds a work-in-progress tree from the
currenttree; on commit the work-in-progress tree becomescurrent. - Lanes are priority bits: a click is urgent (blocking lane);
startTransitionupdates use transition lanes and can be interrupted. - Render work is interruptible; the commit phase is not.
- Fiber is the base for transitions, Suspense, selective hydration and
<Activity>.
The red pen
Common traps: mistake → fix
Mistake: "Fiber is the new virtual DOM"
Fix: it is the reconciler's data structure and work loop.
Mistake: "Fiber renders on multiple threads"
Fix: it is time-slicing on the main thread; JavaScript still runs on one thread.
Mistake: "Commit can be interrupted too"
Fix: only render work can be paused or discarded; commit runs in one go so the DOM is never half-updated.
Easy to hard
Questions interviewers ask, easy to hard
- What problem did Fiber solve compared with the old reconciler?
- What is inside a fiber node?
- What are
currentandworkInProgress? - What are lanes, and how does an urgent click interrupt a transition render?
- How does Fiber make Suspense and selective hydration possible?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.