March 2017
Intermediate to advanced
821 pages
18h 21m
English
Reconciliation is the process by which React updates the DOM whenever the state changes. React doesn't re-render everything from scratch when the state changes; instead, it first finds whether a mutation is required by comparing the new virtual DOM with the old one, and if there is a difference, it compares the new virtual DOM with the real DOM and makes the necessary mutations.
Note that reconciliation doesn't happen only when you change the component state; it also happens when you call ReactDOM.render on the same container element again.
Let's see how exactly reconciliation happens by looking at an example. Suppose this is the initial render:
<ul> <li>Item 1</li> <li>Item 2</li> </ul>
If we remove Item 1 from the state, then ...
Read now
Unlock full access