3 ms·
The real benefit of React is not in virtual DOM, even though virtual DOM enable the real benefit to be feasible. It's in enabling developer to think only in "r
by joesb 12y ago
The real benefit of React is not in virtual DOM, even though virtual DOM enable the real benefit to be feasible.
It's in enabling developer to think only in "recreating the whole DOM".
Subscribing to event and figure out what DOM to update is error prone. With React, you don't think about patching DOM to the right result, you only think about how the final result should looks.
Understanding to latest state of document overtime is also harder with manually patched DOM. You can't be sure how the current DOM looks like after lots of patching.
With React, you know exactly how the current document looks like, given value of props and state. Every programmer knows that referential transparent function is easier to reason about than state full function. React's render method makes rendering a referential transparent function, as opposed to manually patching part of the DOM.
React is not about performance, it's about making it easier to write Component that works. Virtual DOM helps making the idea of rendering the whole thing possible, which happens to also make it fast.