DEV Community

CodeSmithNazim
CodeSmithNazim

Posted on

The Biggest Misconception About React Reconciliation (Render vs. Paint) 2nd part

second part:

  1. The Clash of Two "Renders"

The biggest culprit is that the word "render" means two completely different things in computer science, and React tried to use both at the same time:

Browser Rendering: This is when the browser engine calculates layouts, builds render trees, and paints pixels on your screen.

React Rendering: This is when React calls your component functions to build a JavaScript object tree (virtual DOM) in memory.

Because the browser's process was already called "rendering," React's creators used the same word for their virtual DOM creation. For years, when the docs said "React prevents unnecessary renders," developers read that as "React prevents my components from running their JavaScript." It took years for the community to realize we were talking about two entirely different concepts!

  1. The 2013 "Marketing Pitch"

When React was first introduced in 2013, the web development world was dominated by frameworks like jQuery, Backbone, and AngularJS. In those frameworks, developers had to manually update the browser DOM, or the framework would heavily slow down the browser by sweeping the entire real DOM on every change.

React's biggest selling point was "Stop worrying about manual DOM updates." Just write your UI declaratively. The Virtual DOM will magically do the work of reducing renders."

To sell this idea simply to a skeptical developer audience, the creators packaged the message into "We minimize rendering." It was a highly effective marketing pitch, even if it technically blurred the lines between the JavaScript render phase and the browser paint phase.

  1. The React Team Literally Changed the Docs to Fix This!

The confusion grew so massive that when the React team rewrote the official documentation from scratch (moving to the modern react.dev), they explicitly rewrote the guide to fix this exact misunderstanding.

If you look at the modern "Render and Commit" section of the official docs, they now explicitly separate the process into three distinct steps—Trigger, Render, and Commit—and they added an "Epilogue" just for the browser:

"Epilogue: Browser paint

After rendering is done and React updates the DOM, the browser will repaint the screen. Although this process is known as "browser rendering," we'll refer to it as "painting" to avoid confusion throughout the docs.

They literally had to invent their own terminology ("painting") to stop developers from confusing React's in-memory calculations with actual browser screen updates!

The Verdict:-

When people say "reconciliation decreases the amount of things re-rendered," they are usually using "re-render" as a layman's term for "affecting the actual browser screen."

If you could understand the above two posts, then you understand React's core architecture better than many developers who have been writing it for years.

Top comments (0)