2025-02-26
2777
#react
Ibadehin Mojeed
127976
116
Feb 26, 2025 â‹… 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:

Effective rendering with Selective SSR in TanStack Start

TanStack Start’s Selective SSR lets you control route rendering with server, client, or data-only modes. Learn how it works with a real app example.

Amazing Enyichi Agu
Aug 14, 2025 â‹… 10 min read

The deep internals of event delegation: When bubbling isn’t enough

Learn how event delegation works, why it’s efficient, and how to handle pitfalls, non-bubbling events, and framework-specific implementations.

Clara Ekekenta
Aug 14, 2025 â‹… 10 min read
ai dev tool power rankings

AI dev tool power rankings & comparison [August 2025 edition]

Our August 2025 AI dev tool rankings compare 17 top models and platforms across 40+ features. Use our interactive comparison engine to find the best tool for your needs.

Chizaram Ken
Aug 14, 2025 â‹… 8 min read

React’s `use()` API is about to make useContext obsolete

Learn how React’s new use() API elevates state management and async data fetching for modern, efficient components.

Emmanuel John
Aug 12, 2025 â‹… 7 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