Virtual DOM, Fiber, and Reconciliation in React - Simple & Practical
Shubham
Developer

As you know, I am brushing up my React and JavaScript nowadays, so I’m creating these notes to understand things better.
I found these concepts quite normal to understand... but I don’t know why people struggle with them. Maybe I’m not fully aware yet or maybe my experience just makes them easier for me.
If you’re learning React like me, you probably heard about Virtual DOM, Fiber, and Reconciliation. These three words sound heavy, but once you get the idea, they’re actually pretty simple. Let’s break them down in my way.
Virtual DOM
Virtual DOM is a lightweight, in-memory representation of the real DOM. Think of it as a blueprint React keeps in memory. When your component state changes, React builds a new virtual tree, compares it with the previous one, and finds the smallest set of changes to apply to the real DOM. That way the browser does less work and your UI feels faster.
Why this matters
- Real DOM operations can be slow. Minimizing updates makes apps snappier.
- You write declarative code and React handles the rest.
Small example
function Counter() {
const [n, setN] = useState(0);
return <div><p>{n}</p><button onClick={() => setN(n+1)}>+1</button></div>;
}
When setN runs, React makes a new virtual tree, diffs it with the old tree, and updates only the changed text node. You do not manually touch the DOM.
Fiber
Fiber is React’s engine for rendering and scheduling work. It replaced the old stack-based reconciler so React can break rendering into small units, pause work, resume it, or throw it away if something higher priority arrives. In short, Fiber lets React be responsive even when a lot is happening in the UI.
How to think about it
- Before Fiber: rendering used a single call stack. Big updates could block the main thread.
- With Fiber: updates are chunked and prioritized. React can yield to the browser and come back later.
Why this matters
- Smooth animations and input responsiveness on complex pages.
- Better control over which updates are important and which can wait.
Reconciliation
Reconciliation is the process React uses to decide what changed between two virtual trees. It uses a diffing algorithm and some heuristics so the process is fast and predictable. React compares node types, keys in lists, and component boundaries to choose the minimal updates required.
Practical tips
- Always add
keyon lists. Keys help React track items and avoid unnecessary re-renders. - Avoid changing the component type in place. If you swap a component for a different one, React will re-create that subtree.
Quick checklist for better performance
- Use keys on list items. They are cheap and hugely helpful.
- Keep components small and focused. Smaller trees diff faster.
- Avoid heavy synchronous work during renders. Let React schedule the updates.
- Use
useMemoanduseCallbackonly when you know they help. Overuse can add noise.
TL;DR (one-liner)
Virtual DOM keeps track of what the UI was and compares it to update only the changed elements instead of re-rendering the whole UI.
Fiber is React’s new engine. It can pause, continue, or even cancel rendering tasks. Basically, it prevents multiple unnecessary updates in the UI and applies all changes at once when ready.
Reconciliation is the process that figures out what changed in the UI. It creates a new Virtual DOM tree and compares it with the previous one using a diffing algorithm.
One-liner: React updates only what changed, not the whole thing... and Fiber makes sure it happens smartly.
Sources I used
- React docs: Virtual DOM and reconciliation basics. React
- LogRocket deep dives on Virtual DOM and Fiber. LogRocket Blog
- Developer posts explaining reconciliation and practical gotchas. Developer Way