React is an isomorphic/universal framework.
That means that there is a virtual representation of the UI component tree, and that is separate from the actual rendering that it outputs in the browser.
React is so fast because it never talks to the DOM directly.
Virtual DOM is just a DOM-like data-structure that represents all the UI components hierarchy and additional meta-data.
React is Rendering agnostic, which means that it doesn't care about what is the final output. It can be a DOM Tree in the browser, it can be XML, Native components or JSON.
Applications built with just React usually have a single root
DOM node.
React elements are immutable. Once you create an element, you can’t change its children or attributes. An element is like a single frame in a movie: it represents the UI at a certain point in time.
React DOM compares the element and its children to the previous one, and only applies the DOM updates necessary to bring the DOM to the desired state.
React modifies the DOM by:
So when you render
, you are mounting
to an existing DOM.