4 ms·
Actually, the virtual DOM isn't to prevent unnecessary operations, it's to ensure consistency. State transitions cause a render, which builds the virtual DOM (f
by lobster_johnson 11y ago
Actually, the virtual DOM isn't to prevent unnecessary operations, it's to ensure consistency. State transitions cause a render, which builds the virtual DOM (for each component) from scratch, ensuring that the same state always results in the same rendering output. This is different from, say, Backbone, where you create or modify individual DOM elements, and this logic is typically spread out across many functions.