React integration

useLayoutEffect

Runs client layout work before repaint; avoid blocking paint unnecessarily.

Formal Syntax & Structure

react syntaxreact
useLayoutEffect(() => { measure(); }, [measure])

Working Example

Example Snippetreact
useLayoutEffect(() => { measure(); }, [measure])
React Reference