Reconciliation
In one line
Reconciliation is the process React uses to compare the previous and next virtual DOM trees and determine the minimal set of DOM changes needed.
In simple words
Reconciliation is React's algorithm for updating the real DOM efficiently. When state or props change, React renders the component to produce a new virtual DOM tree. It then walks both the old and new trees simultaneously, comparing nodes.
The algorithm makes assumptions to stay fast: (1) two elements of different types produce completely different trees, so React unmounts the old and mounts the new; (2) elements with the same type and key are considered the same and their props are updated in place. This is why the key prop is important in lists — it helps React match items across renders.
After diffing, React applies the computed mutations to the real DOM in a single batch. This process is what makes React fast: instead of re-rendering the entire page, only the changed parts are updated.
Example
// Before: <li key="a">Apple</li>
// After: <li key="a">Apple</li><li key="b">Banana</li>
// React sees key "a" matches, keeps it, and only inserts the new "b" item.Because keys are stable, React knows the first item didn't change and only adds the new second item, rather than re-rendering the whole list.
Related terms
Related Resources
Related Lessons
- React Overview
Understand how React updates the DOM.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.