is the process by which one can dynamically change the content of the web page. Working with DOM should be fairly easy and quick as it is always tree-structured, traversing the DOM is easy. DOM Manipulation In React, changes are made to the and then synced to the React DOM. This process is call . React can figure out which objects have been changed, and this process is called drifting. Virtual DOM Reconciliation Process of DOM manipulation React will update the Virtual DOM The previous state virtual DOM will then be compared with the updated Virtual DOM, to identify what has been changed in the objects. This is done using the . Diffing Algorithm The changed objects will get updated on the Real DOM. Example of Diffing Algorithm When the root element is different <div> <span> // Old version < /> Tree </ > div // New update < /> Tree </ > span React will , and rebuild the entire tree again. delete the tree When the Attribute is changed in the element <span id= /> <span id= /> // Old "span1" //New "span2" Only the difference will be found in the attribute and will be changed accordingly. New child element added at the end <ul> <li>Child2< l> <ul> <li>Child2< li> // old Child1 < > li </ > li /li> </u //New Child1 < > li </ > li /li> <li>Child3</ </ > ul The new element will be added to the end of the list. New element added at the beginning of the list <ul> <li>Child2< l> <ul> <li>Child1< li> // Old Child1 < > li </ > li /li> </u //New Child3 < > li </ > li /li> <li>Child2</ </ > ul As the new element is added to the beginning it will be rebuilding the entire list again. ☕Thanks For Reading | Happy Coding🤨 I have written over 130+ Article on https://rahulism.tech Previously published at https://rahulism.tech/article/dom-manipulation-in-react/