Virtual DOM
A lightweight copy of the page structure kept as plain JavaScript objects, which a library such as React compares between renders instead of reading the real page.
In more detail
In React the term describes React elements and the tree React builds from them. Comparing two object trees in memory is cheap, so the library computes the few real DOM changes needed and applies only those. The React team now prefers to describe this simply as rendering and reconciliation.
Related terms
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
- React — A JavaScript library for building user interfaces out of components, functions that return a description of what to show.
- RSC payload — The compact data stream React produces from Server Components, describing the rendered tree, props for Client Components and placeholders.
- React element — A plain, read-only JavaScript object describing one piece of UI: its type, its props and an optional key.
- reconciliation — The process where React compares the new tree of elements with the previous one and works out the smallest set of changes to the page.
- diffing algorithm — The rules React uses to compare an old element tree with a new one and find what changed.
Taught in
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Dynamic Routes: Slugs & generateStaticParams — Next.js 15 & Modern App Router Architecture
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture