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:

An Advanced Guide To Vitest Testing And Mocking

An advanced guide to Vitest testing and mocking

Use Vitest to write tests with practical examples and strategies, covering setting up workflows, mocking, and advanced testing techniques.

Sebastian Weber
Jun 6, 2024 â‹… 24 min read
Optimizing Rendering In Vue

Optimizing rendering in Vue

This guide covers methods for enhancing rendering speed in Vue.js apps using functions and techniques like `v-once`, `v-for`, `v-if`, and `v-show`.

Ikeh Akinyemi
Jun 5, 2024 â‹… 8 min read
Using Google Magika To Build An Ai Powered File Type Detector

Using Google Magika to build an AI-powered file type detector

Magika offers extremely accurate file type identification, using deep learning to address the limitations of traditional methods.

Vijit Ail
Jun 4, 2024 â‹… 9 min read
Unistyles Vs Tamagui For Cross Platform React Native Styles

Unistyles vs. Tamagui for cross-platform React Native styles

Unistyles and Tamagui both help address the challenges of creating consistent and responsive styles across different devices.

Popoola Temitope
Jun 3, 2024 â‹… 6 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