Skip to content

React Fiber and Reconciliation

The engine room of React. Fiber architecture, the work loop, concurrent rendering, the reconciliation algorithm, and the commit phase -- understand what React does when you call setState.

1
Fiber Architecture Overview
advanced

React's stack reconciler couldn't pause. Fiber replaced it with an interruptible, linked-list-based work unit system. Each fiber node represents a piece of UI — and React can stop, resume, or discard work on any node at any time.

11 min read
2
The Work Loop and Time Slicing
advanced

React's work loop is a while loop that processes one fiber at a time, checking after each unit whether it should yield to the browser. performUnitOfWork, beginWork, completeWork, and shouldYield form the heartbeat of concurrent React.

11 min read
3
Priority Lanes and Scheduling
advanced

React doesn't treat every update equally. The lane model assigns each update a priority level — SyncLane for clicks, TransitionLane for deferred work, IdleLane for background tasks. Higher-priority lanes interrupt lower ones.

12 min read
4
Reconciliation and Diffing Algorithm
advanced

React's diffing algorithm is O(n), not O(n^3). It achieves this by two heuristics: same type means update, different type means destroy. Keys disambiguate list items. Understanding this algorithm explains every 'unexpected behavior' you've seen.

13 min read
5
Keys, Identity, and Reset Patterns
advanced

Keys aren't just for lists. They control component identity — when React should preserve state and when it should start fresh. Index-as-key creates subtle bugs. Key-as-reset is a deliberate unmount/remount. Master keys to master React.

12 min read
6
Render Phase vs Commit Phase
advanced

React splits work into two phases. The render phase is pure, interruptible, and touches no DOM. The commit phase is synchronous and performs all DOM mutations, ref assignments, and effect execution. Mixing them up causes the hardest React bugs.

11 min read
7
Concurrent Mode and Transitions
advanced

Concurrent rendering lets React work on multiple versions of the UI simultaneously. useTransition and startTransition mark updates as interruptible, keeping the UI responsive during expensive renders. This is how React achieves smooth 60fps during heavy updates.

10 min read
8
Suspense Internals
advanced

Suspense catches thrown promises. When a component throws a promise during render, React shows the fallback UI, waits for the promise to resolve, then retries the render. Under the hood, it's a fiber-level try/catch with special scheduling.

11 min read
9
React 18 Automatic Batching and Transitions
advanced

React 18 batches all state updates everywhere — setTimeout, promises, native events — not just React event handlers. flushSync is the escape hatch. Combined with transitions, this changes how you think about update timing.

10 min read
10
React 19: Compiler, Server Actions, and use()
advanced

React 19 introduces the React Compiler (automatic memoization), the use() hook (read promises and context), Server Actions (mutation without API routes), and form actions. These aren't incremental — they change how you write React.

13 min read
11
Quiz: Reconciliation — What Updates?
advanced

Eight React reconciliation scenarios. For each: predict which DOM nodes React touches, which components re-render, and which state survives. Detailed explanations trace through React's exact diffing logic.

12 min read