0
Why is useLayoutEffect different from useEffect?
subina kallyani
easy
2completed
51
Answer
useEffectruns asynchronously after the browser paints → non-blocking.useLayoutEffectruns synchronously after DOM mutations but before paint → useful when measuring DOM size/position or syncing layout (e.g., scroll position). But it can block rendering if misused.
Click to Reveal Answer
Tap anywhere to see the solution
Revealed
Comments0