idev0085 / react-boilerplate

0 stars 0 forks source link

What is Reconciliation? #82

Open idev0085 opened 3 years ago

idev0085 commented 2 years ago

The Diffing Algorithm When diffing two trees, React first compares the two root elements. The behavior is different depending on the types of the root elements.

Reconciliation is the process through which React updates the DOM. When a component's state changes, React has to calculate if it is necessary to update the DOM. It does this by creating a virtual DOM and comparing it with the current DOM. In this context, the virtual DOM will contain the new state of the component.