paint
The rendering stage that records how to fill in each box's pixels: text, colours, borders, shadows and images.
In more detail
Paint comes after layout and before compositing. Changing a colour or background triggers a repaint but not layout, while changing transform or opacity can skip both.
Example
useLayoutEffect runs before this paint, so its changes are never seen half-done; useEffect normally runs after it.Related terms
- layout — The rendering stage in which the browser calculates the exact position and size of every box on the page.
- rasterization — Turning drawing instructions, such as draw this text in this font, into an actual grid of coloured pixels.
- compositing — The final rendering stage, in which separately painted layers are stacked and drawn together on screen, usually by the GPU.
- useLayoutEffect — A version of useEffect that runs synchronously after React changes the DOM but before the browser paints the screen.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- frame — One screen update; browsers aim for about 60 frames per second, which leaves roughly 16 milliseconds to do each frame work.
Taught in
- Layout, Reflow, Paint And GPU Compositing Layers — Frontend Architecture & Web Platform
- CSS Custom Properties: Scoping, Fallbacks And Theming — Frontend Architecture & Web Platform
- Modern CSS Animations, Transitions And View Transitions API — Frontend Architecture & Web Platform
- requestAnimationFrame vs requestIdleCallback: High-FPS Work — Frontend Architecture & Web Platform
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture