Explain what a fiber is (one object per component with parent, child and sibling pointers, state, flags and lanes), why React replaced its recursive reconciler, how the work loop renders and yields, how lanes rank updates, and why the commit runs in one synchronous pass.
Frontend interview practice question
What is React Fiber, and how does it decide which work to do first?
Interview quick answer
Interview focus
This React interview question tests whether you can explain React Fiber Explained: Fibers, Lanes and the Work Loop, connect it to production trade-offs, and handle common follow-up questions.
- React Fiber Explained: Fibers, Lanes and the Work Loop explanation without falling back to memorized definitions
- Rendering and Concurrent reasoning, edge cases, and production failure modes
- How you would answer the most likely React interview follow-up
Use this React interview question to rehearse a quick answer, common mistake, follow-up, and production pitfall.
Full interview answer
The short answer
Fiber is the reconciler React has used since version 16; interruptible rendering came later, with createRoot in React 18, and before that every render ran to completion. For every element in the tree (components, DOM elements, text, fragments, context providers, Suspense boundaries) React keeps a fiber: a plain object that holds its type, props, state and pending work, plus pointers to its parent, first child and next sibling. Rendering is a loop over those objects instead of a chain of nested function calls, so for low-priority updates React can stop after any fiber, let the browser handle input, and come back: it resumes where it stopped if nothing new arrived, and starts over if another update did, whether more urgent or simply newer, such as the next keystroke's transition.
Each update carries a lane, one bit in a priority mask; the lanes React renders together decide whether that render may be interrupted at all. When a tree is finished, React commits it in one synchronous pass.
Why React needed it
The reconciler before React 16 walked the tree recursively, one JavaScript call per component. Once an update started, the call stack had to unwind completely before the browser could do anything else, so a large update blocked typing and animation for its whole duration. Fiber moves that stack into objects React manages itself: each fiber works like a stack frame that React can stop between, keep, and come back to.
Field | What it is for |
|---|---|
type, key | Which component or DOM tag this is, and its identity among its siblings |
pendingProps, memoizedProps | The props for this render and those of the last finished render; the same props object (or props React.memo finds shallowly equal) lets React skip the component |
memoizedState | The component's state; for a function component, the linked list of its hooks |
return, child, sibling | Parent, first child and next sibling: the tree as a linked list React walks without recursion |
alternate | The same component's fiber in the other tree, current or work-in-progress |
flags, subtreeFlags | What the commit has to do here (insert, update, delete, run effects) and whether anything below needs it |
lanes, childLanes | The priorities of pending updates on this fiber and anywhere below it |
stateNode | The DOM node or class instance this fiber manages |
// <App> renders <Header /> and <List>; <List> renders two <Item>s.
// Their fibers point at each other like this:
//
// App.child = Header
// Header.sibling = List
// List.child = Item #1
// Item #1.sibling = Item #2
// Every fiber's .return points at its parent.
Two trees, and the switch at commit
React keeps up to two copies of each fiber. The current tree matches what is on screen; the work-in-progress tree is built during render, and subtrees that did not change are shared rather than copied. Each fiber's alternate points at its twin, and React reuses that twin instead of allocating a new object on every update. When the work-in-progress tree is complete, the commit applies its DOM changes and points the root at it, so the finished tree becomes current. Because the page's DOM changes only in that synchronous commit, the user never sees a half-built update, however many times the render paused.
The work loop
Rendering is a loop over units of work. For each fiber React calls beginWork: it calls the component function (or, for a DOM element, takes its props) and creates or reuses fibers for the children; then it moves to the first child. When a fiber has no child left, completeWork creates its DOM node if it is new, still detached from the page, and merges its flags into its parent's so the commit knows which branches need work; then the loop moves to the sibling, or back to the parent when there is none. A fiber that receives the same props object, has no update of its own and reads no changed context is skipped, and if its childLanes show no work at the priority being rendered, so is its whole subtree.
// Simplified from React's ReactFiberWorkLoop.js (v19.1;
// React 18 calls the second loop workLoopConcurrent)
function workLoopSync() {
while (workInProgress !== null) {
performUnitOfWork(workInProgress);
}
}
function workLoopConcurrentByScheduler() {
// shouldYield() turns true after about 5 ms of work
while (workInProgress !== null && !shouldYield()) {
performUnitOfWork(workInProgress);
}
}
The only difference between the two loops is the shouldYield() check. It comes from React's own Scheduler package, which hands the main thread back about every 5 ms and asks to continue with a MessageChannel message in the browser (setImmediate in Node). React does not use requestIdleCallback for this.
Where the update comes from | Lane | Can its render be interrupted? |
|---|---|---|
Click, key press, input and other discrete events; setState in a layout effect | SyncLane | No: rendered and committed before the browser paints (in a microtask after an event, at the end of the commit after a layout effect) |
Scroll, mousemove and other continuous events | InputContinuousLane | No |
setState outside an event: a timer, a fetch response, a useEffect | DefaultLane | No: rendered in one go, even under createRoot |
startTransition, useDeferredValue | Transition lanes | Yes: rendered in slices, and restarted when a more urgent update arrives |
Suspense retries, offscreen and idle work | Retry, Offscreen and Idle lanes | Yes |
Which work goes first
Lanes are bits in a 31-bit mask, and a lower bit means more urgent. When React picks its next render it takes the most urgent pending lanes, so a click is rendered ahead of a transition that started earlier. If the click arrives while the transition is half-rendered, React drops the unfinished tree, renders and commits the click, then renders the transition again on top of the new state, replaying its updates in their original order. Masks also let React merge several pending updates into one render and test a whole subtree with one bitwise AND. A transition lane that waits too long expires after about five seconds and then renders without yielding, so it cannot starve behind newer work.
What yielding cannot do
React can only yield between fibers. If one component's render takes 280 ms, because it filters 50,000 rows inline or builds a chart synchronously, a transition still blocks for those 280 ms: that render is a single unit of work, and the browser gets the thread back only when it ends. The fix is a smaller unit or less work, not another startTransition: precompute or index the data, virtualize the list, split the component so each part is cheap, or move the calculation to a worker.
Common misconceptions
• "Fiber renders in parallel." Everything runs on the main thread; Fiber only takes turns with the browser.
• "Since React 18 every render is interruptible." Only transition, retry, offscreen and idle work is sliced, and an expired transition is not. Clicks, typing and ordinary state updates render without yielding.
• "The commit can pause too." No. It runs in one synchronous pass, so the DOM never shows a mix of old and new.
• "Fiber is just another name for the virtual DOM." React elements are the description your components return; fibers are the mutable records React keeps between renders to compare them and track the work.
Follow-up: "What are Fiber's scheduling strategies?"
Some interviewers ask for them as a list:
• Time slicing: fiber-sized units of work, with a yield about every 5 ms for interruptible lanes.
• Priorities: lanes rank updates from discrete input down to idle work.
• Interruption and restart: a more urgent update discards the unfinished tree.
• Starvation protection: expired transition lanes render without yielding.
Follow-up: what does interruption cost your code?
A sliced render can read a mutable store at two different moments and show two versions of it on one screen, which is called tearing. useSyncExternalStore prevents it: when the store changes during a concurrent render, React renders that update again without yielding. It is also why render must stay pure: a render can be paused and thrown away.
For what happens on each side of the render and commit split, see render phase vs commit phase. For the APIs that move an update into an interruptible lane, see concurrent rendering.
Interview framing
Say it like this:
"A fiber is React's record for one element in the tree, a component or a DOM node: its props, state, pending work and links to parent, child and sibling. Rendering walks those records in a loop, so React can stop between any two of them. For transitions and other low-priority lanes it yields about every 5 ms and can throw the half-built tree away when something more urgent arrives; clicks, typing and default updates render without yielding. The finished tree is committed in one synchronous pass, which is why the user never sees a partial update."
Summary
Fiber turns rendering from one recursive call into a loop over records it can pause between. Lanes decide which updates may wait, and a synchronous commit keeps the screen consistent. Work inside a single component still runs to the end.
Use this as one explanation rep, then continue with the React interview questions cluster or a guided prep path.
Built in public
The code behind FrontendAtlas lives on GitHub. A star helps other frontend engineers find it.