October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

30 Days of Frontend — Day 2: React Reconciliation Explained

React reconciliation connects new component output with the previous render. Learn how render and commit differ, why stable list keys matter, and how changing a key resets state.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

React reconciliation is how React relates a component’s latest rendered output to its previous output and determines what the renderer needs to update. A component can render again without React changing the DOM: rendering calculates the next UI, while committing applies the necessary host changes.

What happens after a state update?

Suppose a counter starts at 0 and a click changes its state to 1. React calls the component to calculate its next output, then determines whether that output requires a change to the host UI. In React DOM, that means updating the DOM where needed.

As an Amazon Associate I earn from qualifying purchases.

These are distinct parts of the update:

  • Render: React calculates what the UI should look like from the current props and state.
  • Commit: React applies the necessary changes to the host environment, such as the DOM in a web app.

A render does not necessarily cause a DOM mutation. As the React documentation puts it, “React only changes the DOM nodes if there’s a difference between renders.” React: Render and Commit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How does React decide what to preserve?

React associates state with a component’s identity in the render tree. Position, element type, and key help determine whether a new element corresponds to the component that occupied a place before. When identity matches, React can preserve state and reuse host nodes where applicable; that does not mean the component is skipped or its output cannot change.

What changes? Likely identity result What to expect
The same component type remains at the same position with the same key Identity is preserved React can keep its state across renders.
The component type at that position changes It is a different identity The previous component’s state is not carried into the new component.
The key changes It is a different identity React resets that component’s state and treats it as a new instance.

This is why changing a key can deliberately reset a form or other component state. It is also why defining a new component function inside another component can cause state to reset: the nested function creates a different component type on each render. See React: Preserving and Resetting State.

Why do list keys matter?

A key gives an item a stable identity among its siblings, helping React match list entries when the list changes. Use a stable ID from the data when available. Keys need to be unique among siblings, not globally across the entire app.

Key strategy Identity stability Insertion, deletion, or reorder Does state follow the intended item?
Stable data ID Stable when the ID belongs to the same item Lets React match items across list changes Yes, when IDs are unique among siblings and consistently identify items.
Array index Changes meaning when items shift position Can associate an existing component with a different item after insertion, deletion, or reorder Not reliably when list order or membership changes.
Generated key on each render Unstable by design Makes items appear new on each render No; component state and reuse can be lost.

Index keys can be acceptable for a list that is static and will not be reordered or have items inserted or removed. For changing lists, use stable data IDs so state stays with the intended item. Do not generate keys during rendering when a stable identity is available. React’s Rendering Lists guide explains key requirements and common mistakes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is reconciliation just a virtual DOM diff?

“Virtual DOM diff” is a convenient shorthand, but it can imply that application developers must build or control a manual tree comparison. They generally do not: describe the UI for the current props and state, and React handles relating that output to what came before.

Reconciliation is an implementation detail. Avoid relying on claims about a universal minimal-operation algorithm, exact diff complexity, scheduler behavior, or internal Fiber fields as if they were stable application APIs. React’s reconciler repository README is aimed at renderer authors, notes that its reference is incomplete, and explains that host configuration changes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does React Native reconcile the same way as React DOM?

React concepts such as component identity and state apply across React renderers, but React DOM and React Native target different host environments. React DOM updates browser DOM nodes; React Native’s renderer works with its own host UI.

React Native’s New Architecture describes separate render, commit, and mount phases. That is useful context, but DOM-specific details should not be assumed to describe React Native’s host updates. See React Native: Render, Commit, and Mount.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For additional historical implementation context, Andrew Clark’s React Fiber architecture notes are non-official and may become stale. They are not a substitute for the public React documentation or a release-specific implementation reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.