The virtual DOM is an in-memory representation of the actual DOM. It has the elements, attributes, and content as Objects and their properties. The Virtual DOM saves time from unnecessary DOM modifications. React has the application state represented as a Virtual DOM and below are the steps that React performs when the application state changes,
1. Auto-generate a new Virtual DOM that represents the application state
2. Compare the old (current HTML DOM) vs the new Virtual DOMs
3. New operations will be mapped into the same HTML DOM operations
Note:- The Virtual DOM is only a copy of the original HTML DOM