Michael Kalmykov8,915 Points
How is react more preformant? it sounds like it's building two doms.
it seems like it'd take the time to build the virtual dom, and then take the time to build the real dom
Michael Liendo15,326 Points
React first builds its virtual DOM then determines, based on changes that occur in the application, how the DOM should be rendered. So imagine you have a list of 100 items. Each item is an object. On a real DOM, if a change was made (say you updated one of the objects) then the entire DOM would be re-rendered ie) all 100 objects.
In React, because all of the changes are made on the virtual DOM, React says, "Ok, we see that you only made a change to 1 object, so instead of re-rendering the entire DOM all over again, I'm just going to re-render this one object."
Also, (a lesser know fact) is that React takes all user input and converts it to a String. Might not seem like a big deal at first glance, but what that means is that malicious injections (someone typing in code to try and access your code) are prevented. Another advantage of working with a virtual DOM.
Keith Dowd4,404 Points
@Sachin P This is a good question. I think it's just the reality that browsers cannot keep pace with innovation.