Initially, the purpose of JavaScript was to validate forms; later, JavaScript was also able to manipulate the DOM and add CSS styles.

Conflicts :

Types of compilation :

If you want to update something, traverse the DOM tree and update and render it. The traversing thing is very costly if it is too deeply nested, and updating and rendering are more costly, so to solve this problem by using frameworks like React or Angular.

Basically React never updates the original DOM tree directly. React creates a virtual DOM object that looks exactly the same as the original DOM tree. Virtual DOM is nothing but an in-memory copy of your original DOM. First, React updates the virtual DOM directly. It never updates the original DOM directly. At some later point in time, based on certain algorithms, it will update the original DOM partially based on whatever is changing the virtual DOM.

Reconciliation: React keeps the in-memory virtual DOM representation of the actual DOM and keeps it in sync with a batch update. This process is called as reconciliation.

root: if the root itself was changed, this means it will tear down the previous virtual dom tree and the latest version of the virtual dom that particular section itself gets updated, so if this happens only happen if the root gets changed.

attribute: In this case, there is no tear-down happening; only the attribute section has been changed, and only that particular portion will be reflected or changed as part of a batch update to the original DOM

Dom: document object model.