liveBook · Manning

Reconciliation

As explained in Acing the Frontend Interview

The React process of determining the differences between interface representations before applying updates.

In React, reconciliation is the process of determining what changed between interface representations before updating the real DOM. It supports declarative UI: describe what the interface should look like for the current state, rather than issuing DOM operations yourself. section 4.1

Interview scenario: a like count changes

Suppose a component displays a dynamic like count. Rather than manually finding its DOM node and replacing its text, you update the state that determines the display. React compares the previous and next UI representations, identifies differences, and applies the needed DOM updates. If asked why this matters, distinguish the desired UI from the work React does to reach it. section 4.1 section 1.3

A useful follow-up answer separates three related ideas:

  • The Virtual DOM represents the UI as a lightweight JavaScript object tree that can be compared across states. section 4.1
  • Reconciliation identifies differences; the rendering account places it in the pre-commit phase, before the commit phase applies updates. section 1.3
  • Fiber is React’s reconciliation engine for scheduling, prioritizing, and dividing rendering work into smaller units. It addresses how and when work proceeds, not merely what differs. section 4.1
Table 4.4 Distinctions between Virtual DOM and Fiber Architecture
Aspect
Virtual DOM
Fiber Architecture
Definition
A lightweight JavaScript object tree representing the UI.
React’s internal reconciliation engine for managing rendering work.
Purpose
Provides an abstract layer for diffing and detecting changes between UI states.
Handles task scheduling, prioritization, and incremental rendering.
Focus
Determines what needs to be updated in the real DOM.
Determines how and when updates are applied to the DOM.
Granularity
Operates at the component and element tree level.
Breaks work into small units (fibers) for fine-grained control.
Update style
Applies batched, synchronous updates (pre-Fiber React).
Enables asynchronous, interruptible rendering for better responsiveness.

Use the comparison to keep Virtual DOM diffing distinct from Fiber’s control over rendering work. section 4.1

For a performance follow-up, connect reconciliation to avoiding unnecessary DOM mutations and to investigating unnecessary rerenders. Be ready to trace an update and explain the distinction between detecting a change and scheduling its work. section 4.1 section 1.3

How Acing the Frontend Interview covers it

How deep it goes
Traces comparison of UI states through pre-commit and commit phases, then distinguishes Fiber scheduling from Virtual DOM diffing.
Examples
Uses a dynamic like-count interface and contrasts JSX-driven updates with manual DOM creation.
What it assumes
Builds on React components and state-driven UI while explaining the Virtual DOM and Fiber distinction.
What you can do after
Evaluate/understand React updates by tracing UI differences and distinguishing reconciliation from Fiber scheduling and DOM commits.
How it connects
Connects reconciliation to declarative UI, the Virtual DOM, DOM mutations, React Fiber, and rendering performance.

Also explained in

Compare how 8 books explain reconciliation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Frontend Interview. The section links point to the parts of the book it draws on.