flicker
A brief visible jump where the screen shows one layout and then quickly redraws another.
In more detail
It happens when code measures the DOM after the browser has already painted, for example in useEffect, and then moves an element. Doing the measurement and update in useLayoutEffect lets the user see only the final position.
Related terms
- useLayoutEffect — A version of useEffect that runs synchronously after React changes the DOM but before the browser paints the screen.
- paint — The rendering stage that records how to fill in each box's pixels: text, colours, borders, shadows and images.
Taught in
- Avoiding Effect Antipatterns: Derived State And Events — React 19 & Modern Component Architecture
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture
- useId: Generating Stable Accessible Form Element Identifiers — React 19 & Modern Component Architecture