2 ms·
The real reason is because it’s faster (or was in 2014) to diff 2 versions of an optimized in-memory tree than it is to use the dom API to diff live html (where
by dartos 2y ago
The real reason is because it’s faster (or was in 2014) to diff 2 versions of an optimized in-memory tree than it is to use the dom API to diff live html (where any change might trigger the browser’s layout and rendering pipeline)
That’s why react opted for a virtual dom. Many frameworks followed suit.
We’re a decade on at this point and JavaScript runtimes are much faster