🌐Virtual DOM
Also known as VDOM, Virtual Document Object Model, DOM Diffing
A copy of the page kept in memory. The app checks two copies and fixes only what changed.
Think of it like
It is like checking a new list with the old one. Then you fix just the lines that changed.
Example
Lucy's list has 500 rows, and one price changes. The virtual DOM finds that one change, so only one line on the page is redrawn.
Why it matters
You can write code as if the whole page is redrawn each time. The library does the careful, small updates for you.
Definition
Common mistake
Key takeaways
- 1A copy in memory. Light to build and to compare.
- 2Compare, then patch. Only the changes reach the page.
- 3You write simply. The library handles the updates.