Understand Virtual DOM in React and What Makes It Great

Understand Virtual DOM in React and What Makes It Great

What is a virtual DOM?

How does Virtual DOM actually work?

<div>
<div>
<h1>Hello World</h1>
</div>
<div>
<h1>Hello Universe</h1>
</div>
</div>

Copyright TechPlanet.today

<div>
<div>
<h1>Hello World</h1>
</div>
<div>
<h1>Hello Planet</h1>
</div>
</div>
Understand Virtual DOM in React and What Makes It Great

The Functional aspects of Virtual DOM

  1. Speed and performance boost
  2. Lightweight
  3. It is simple and clear
  4. Amazing diffing algorithm
  5. It can be used on other frameworks not just react
  1. Higher memory usage problems as the diffing algorithms need to keep comparing the elements to know which components needs to be updated or changed.
  2. It is not easily integrated into many other frameworks.
  3. You can’t use it or target template engines.

Even at the cons mentioned above, virtual DOM is always the go-to because of the boost in performance and speed it offers.

What can we conclude?

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.

Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up