4 ms·
It's no surprise that mutating data structures is cheap, and React's virtual DOM doesn't aim to solve expensive layout calculation. What virtual DOM does is si
by munro 11y ago
It's no surprise that mutating data structures is cheap, and React's virtual DOM doesn't aim to solve expensive layout calculation.
What virtual DOM does is simplify application development by removing the concept of time, so the programmer doesn't have to think about how to mutate the existing state to get to the new state. It's the cheapness of creating new virtual nodes that's interesting [1], and quickly applying them to the DOM with diffing.
[1] https://jsperf.com/virtual-dom-vs-real-dom https://jsperf.com/virtual-dom-vs-real-dom