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:

Is OpenNext really the key to Next.js portability?

There’s been major controversy surrounding Next.js’s openness. Discover how OpenNext is addressing the bubbling issue of Next.js portability.

Elijah Asaolu
Apr 30, 2025 ⋅ 5 min read

Solid series: Single Responsibility Principle (SRP)

By using SRP, developers can produce code that is easier to debug, test, and extend, making it clearer, more maintainable, and scalable.

Oyinkansola Awosan
Apr 30, 2025 ⋅ 8 min read

Axios POST requests: Handling errors, authentication, & best practices

Learn about the Axios POST method and discover how to deploy it in vanilla JavaScript and frameworks like React.

Chimezie Innocent
Apr 29, 2025 ⋅ 16 min read

Creating server-driven web apps with htmx

Explore htmx, a small browser-oriented JavaScript library aimed at building no-nonsense, server-driven web apps.

Elijah Asaolu
Apr 29, 2025 ⋅ 16 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