Skip to main content

Fiber, Render Work, and Scheduling

React exposes a declarative API, but internally it must process updates, call components and Hooks, reconcile identities, coordinate Suspense, prioritize work, and commit accepted results.

Conceptual model: Fiber is React's internal work architecture, not an application API. Do not depend on private fields, flags, lane values, or traversal details.

Why React needs interruptible work​

A huge render should not behave like one indivisible application task
Update arrives
new state/props/context
Render work
evaluate component tree in units of work
Finish
candidate ready
Interrupt
higher-priority work arrives
Restart
recompute from fresher inputs
Abandon
obsolete candidate never commits

The value is scheduling flexibility, not magical parallel JavaScript execution.

Treat Fiber as an internal work record​

A useful conceptual Fiber record connects:

Identity
component + tree position
Relationships
parent · child · sibling work
Updates
pending state/update information
Hooks/state
bookkeeping for this identity
Priority
scheduling information
Commit data
work needed to publish accepted changes

Never read undocumented DOM properties such as __reactFiber$... in application code.

Render and commit are separate phases​

Render calculates; commit publishes
Render phase
call components · read snapshots · reconcile · may suspend/restart/abort
Commit phase
host mutations · refs · layout work · externally visible result

This separation is why render-time side effects are unsafe: a render attempt can happen without ever committing.

Only commits become visible​

React may evaluate work the user never sees
1Render attempt A
2Interrupted/obsolete
3Render attempt B
4Commit B

A console.log() during render means React evaluated the component, not that the user observed that candidate UI.

Concurrency is cooperative scheduling​

Concurrency changes scheduling, not JavaScript's thread model
React concurrency
prioritize · interrupt · restart · discard render work
Not automatic parallel CPU
does not move arbitrary synchronous calculations to another thread

If one component performs a huge synchronous calculation, you may still need better algorithms, less data, virtualization, server computation, caching, or a Web Worker.

Urgent vs Transition work​

How urgent is this update to the user?
Controlled input / direct manipulation / immediate accessibility stateKeep urgent
Large secondary view / route transition / expensive result refreshMay be a Transition
A value may intentionally lag behind an urgent valueConsider useDeferredValue
const [isPending, startTransition] = useTransition();

function selectTab(tab) {
startTransition(() => {
setSelectedTab(tab);
});
}

Transition work is non-blocking and interruptible relative to urgent work. It does not make expensive computation cheaper.

Do not depend on lanes​

Articles and source code often discuss lanes, React's internal priority representation.

Use the concept, not the representation
Stable idea
updates carry scheduling intent and React coordinates priorities
Lanes
private representation that may change

Application code should use public APIs such as state updates, startTransition, useTransition, useDeferredValue, Suspense, and <Activity> rather than lane bitmasks or private Scheduler assumptions.

State is a render snapshot​

function Counter() {
const [count, setCount] = useState(0);

function handleClick() {
setCount(count + 1);
console.log(count);
}
}

The handler sees the state snapshot from the render that created it.

Updates request a future snapshot; they do not mutate the current one
Current snapshot
count = 0
Pending update
request next state
Next snapshot
count = 1

Update queues are a stable mental model​

setCount(c => c + 1);
setCount(c => c + 1);
setCount(c => c + 1);
1Updates requested
2React queues/processes them
3Render computes next snapshot
4Commit publishes accepted state

You do not need internal queue node structures to reason correctly about functional updates.

Restartable work makes purity essential​

Why render purity is architectural, not stylistic
React may retry render
same logical update can be evaluated more than once
Render must be idempotent
no external side effects · no mutation of snapshots

Event-caused work belongs in event handlers. Synchronization with external systems belongs in Effects. Render calculates UI.

Stable contract vs implementation detail​

Use in app reasoning
render/commit split · snapshots · interruptibility · public scheduling APIs
Keep out of app dependencies
Fiber fields · flags · lane constants · traversal order · private scheduler APIs

Senior-level internals knowledge should help explain public behavior while preserving the freedom for React's implementation to evolve.