2022-08-16
2538
#react
Ibadehin Mojeed
127976
Aug 16, 2022 â‹… 9 min read

What is the virtual DOM in React?

Ibadehin Mojeed I'm an advocate of project-based learning. I also write technical content around web development.

Recent posts:

Simplifying CSS Animations With The `Display` And `Size` Properties

Simplifying CSS animations with the display and size properties

New CSS features simplify animating elements by allowing transitions for display and size properties, reducing the need for complex JavaScript workarounds.

Saleh Mubashar
Oct 24, 2024 â‹… 7 min read
The Best React Select Component Libraries

The best React select component libraries

Explore select libraries in React, including React Select and alternatives like Downshift, Choice.js, and more.

Jude Miracle
Oct 23, 2024 â‹… 7 min read

A guide to the best email editing tools

Learn about open-source and free email editors that streamline template creation, and then check out how to test them.

Isaac Okoro
Oct 22, 2024 â‹… 4 min read
Deep Dive React Fiber

A deep dive into React Fiber

Learn about React Fiber, an internal engine change geared to make React faster and smarter by solving the DOM tree issue.

Karthik Kalyanaraman
Oct 22, 2024 â‹… 20 min read
View all posts

6 Replies to "What is the virtual DOM in React?"

  1. Thank you for the great article it helped me understand the concept of real & virtual DOM through such amazing examples & illustrations.

    A summary of my understanding is that the main DOM is a tree structure of all the elements in the HTML page. When there’s changes in the UI, re-rendering the whole page is costly so in react there’s the concept of virtual DOM where in memory objects are used to keep track of the changes in UI. React uses reconciliation (a diffing algo to compare the snapshots of the virtual DOM tree) & ReactDOM library to update the actual DOM.

  2. Why use all this HTML in JS code? If we can render only the element where the clock will be. The Form is a separate component. The example does not contain anything useful

Leave a Reply