-
A
Virtual DOM
-
B
DOM
-
C
Elements
-
D
Components
A
Answer:
A
Is React really fast?
DOM
- Reading and writing is really slow in DOM.
- Changing the whole DOM each time when there is an update will slow down the page.
Virtual DOM
- Has rapid DOM rendering speed because manipulating the virtual DOM is much faster, because nothing gets drawn onscreen.
- Only the required part of DOM is updated.
What is exciting here?
For creating dynamic UI, DOM was never an optimized solution. Consider a page displaying a list containing 10 items and one is getting updated. While performing update, DOM will rebuild the entire list making it work 10 times more than what is necessary. This inefficiency can be overcome using Virtual DOM.
Virtual DOM is an abstract, lightweight copy of DOM. It can be changed as and when we want and then can be saved to the real DOM. Whenever a change occurs, Virtual DOM efficiently rerenders the DOM. It is much faster than DOM.
Virtual DOM (Document Object Model) has the same properties as a real DOM object.
React postulated the idea of Virtual DOM. It is commonly used in PayPal
, Apple
and Facebook
.