React JS

Virtual DOM

Virtual DOM

The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the structure of a document as a tree of objects, with each objects representing a part of the document (such as an element or an attribute). The DOM allows programs to access and modify the content and structure of a document. 
The Virtual DOM is a concept that was introduced with React, and it is a lightweight in-memory representation of the actual DOM. When a React application is rendered, the virtual DOM creates a virtual representation of the DOM tree, which is then used to determine the minimal number of changes that need to be made to the actual DOM in order to update the user interface. 

This process of updating the DOM through the virtual DOM is known as "reconciliation." When the virtual DOM determines that a change needs to be made to the actual DOM, it creates a new virtual tree that represents the updated state of the user interface, and then it compares the new tree to the previous tree to determine the minimal set of changes that need to be made. When the state of a React component changes, the virtual DOM is updated instead of the actual DOM. This allows React to determine the minimal set of changes that need to be made to the DOM, which can greatly improve the performance of applications with large amounts of data that rely on frequent updates. 
Overall, the virtual DOM is an important concept in React, as it helps to make it easier to build and maintain efficient and performant user interfaces.
 

Top course recommendations for you

    JQuery Tutorial
    1 hrs
    Beginner
    10.9K+ Learners
    4.41  (543)
    What is IoT?
    1 hrs
    Beginner
    29.6K+ Learners
    4.46  (2187)
    Mongodb Tutorial
    2 hrs
    Beginner
    20.1K+ Learners
    4.58  (1106)
    Android App with Python
    2 hrs
    Beginner
    30.2K+ Learners
    4.44  (726)
    JavaScript Projects
    2 hrs
    Intermediate
    35.6K+ Learners
    4.52  (1280)
    HTML Attributes and Tags
    2 hrs
    Beginner
    46.5K+ Learners
    4.58  (2499)
    HTML Tutorial
    6 hrs
    Intermediate
    52.4K+ Learners
    4.5  (1226)
    CSS Properties
    2 hrs
    Beginner
    22K+ Learners
    4.51  (948)
    CSS Tutorial
    2 hrs
    Intermediate
    37.7K+ Learners
    4.54  (1794)
    Broadband Database Management System
    2 hrs
    Intermediate
    8.1K+ Learners
    4.5  (143)