Promptles
React & Frontend

Virtual DOM

intermediate

Definition

A lightweight, in-memory sketch of what a webpage should look like. When something changes, the app draws a new sketch, compares it with the old one, and only updates the parts of the actual page that are different. This makes updates much faster than redrawing everything.

In the wild

On a long social feed, you click 'like' on a single post. Behind the scenes, the app makes a new sketch of the whole feed, notices that only that one post's like-count is different, and updates just that little number: leaving the rest of the page completely untouched.

More from React & Frontend