Skip to main content

Posts

Showing posts with the label React

Demystifying React ’s Virtual DOM

React has become one of the most popular Javascript UI libraries and today we are going to see one of the most important reasons behind it — its efficiency in updating the DOM. That’s where React ’s Virtual DOM comes into play. What is Virtual DOM? Virtual DOM is in-memory representation of the Real DOM. It is a lightweight JavaScript object which is a copy of the Real DOM. If it’s a copy of the real DOM, why do we say it makes the update faster? For that we first see… Why is real DOM update slow? Or is it really? Updating real DOM is not slow.Its merely updating a javascript object. Let’s now look at what actually makes the update process slower. Rendering engine which is responsible for displaying or rendering the web page on the browser screen parses the HTML page to create the DOM. It also parses the CSS and applies the CSS to the HTML creating a render tree, this process is called as attachment . Layout process give exact coordinates to each node of the render tree, whe...