

The first point is arguably not that important since React manages to calculate the difference quite efficiently. All your code in these render functions or function components will be executed again.React has to run its diffing algorithm on each of those components to check whether it should update.The execution of these render functions has two drawbacks: The bad news is: All those red dots on the left-hand side mean that the render function of these components The good news is that you don't have to worry too much about the performance bottlenecks of UI re-draws. In the real DOM, this means re-painting the UI.

In React, this means calling the render function. UI change, the ReactDOM library will efficiently do this by trying to update only what needs to be updated.įor example, if only the attribute of an element changes, React will only update the attribute of the HTML element byĬalling tAttribute (or something similar). State changes in your application will be applied to the VDOM first. It consists of your React application's elements. Then we have the Virtual DOM (or VDOM) of React, another abstraction layer on top of that. You can modify the DOM with JavaScript through the DOM programming interface that containsįunctions like document.write, Node.appendChild or tAttribute. In plain English, this means that the DOM represents what you see on your screen when you open a website,Įxpressed through the markup language HTML.īrowsers allow the JavaScript language to modify the DOM through an API: The globally available document represents that state of the HTML DOM and provides us with functions to modify it. "The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document." To start off, we need to understand what the DOM (Document Object Model) is: In any case, ultimately, it describes the process of generating an image. Rendering is a term that can be understood on different levels of abstraction.ĭepending on the context, it has a slightly different meaning. Understand what happens behind the scenes of the library. If we want to understand how React renders and re-renders work, it's a good idea to
