𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗥𝗲𝗮𝗰𝘁 𝗥𝗲𝗻𝗱𝗲𝗿𝗶𝗻𝗴

Rendering turns your React components into elements. The browser shows these elements on the screen. React re-renders a component when its state or props change.

Two types of rendering exist:

  1. Initial Rendering This happens when your app loads. React builds the component tree and puts it on the page.

  2. Re-Rendering This happens when data changes. A component re-renders if:

The Virtual DOM improves speed. React follows these steps:

This comparison process is called Reconciliation. It prevents React from rebuilding your entire page. It only updates what is different.

Avoid unnecessary re-renders to keep your app fast. Use these three tools:

The rendering lifecycle follows this path:

Source: https://dev.to/aj_arul/understanding-react-rendering-242p