How Virtual DOM works?

DWQA QuestionsCategory: Web Design HTMLHow Virtual DOM works?
Editor Staff asked 2 weeks ago

How Virtual DOM works?

1 Answers
Editor Staff answered 2 weeks ago
  1. The Virtual DOM works in three simple steps.

    1. Whenever any underlying data changes, the entire UI is re-rendered in Virtual DOM representation.
      vdom
    2. Then the difference between the previous DOM representation and the new one is calculated.
      vdom2
    3. Once the calculations are done, the real DOM will be updated with only the things that have actually changed.
      vdom3