Glossary term
What is useLayoutEffect? Meaning for developers
Like useEffect, but it runs after DOM changes and before the browser paints. Use it to measure layout without flicker.
Learn it properly · Senior Frontend DepthLesson 1: Hooks in Depth: Effects, Refs and the RulesEffect dependencies, stale closures, useRef vs state, useLayoutEffect and the idea behind “You Might Not Need an Effect”.