Performance
DOM updates are costly. Repaints and reflows are synchronous events and therefore, they need to be minimized as much as possible. React deals with this scenario by maintaining a virtual DOM, which makes React applications really fast.
Whenever we make a modification to the JSX element in the render method, React will update the virtual DOM instead of the real DOM. Updating the virtual DOM is fast, efficient, and much less expensive than updating the real DOM and only the elements that are changed in the virtual DOM will be modified in the actual DOM. React does this by using a smart diffing algorithm, which we mostly won't have to worry about.
To understand how React works in detail and its performance, you can read the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access