← React Intermediate Questions - Set 5 Q44

What is the difference between `useEffect` and `useLayoutEffect`?

React Intermediate Questions - Set 5

Example

useLayoutEffect(() => measure(), []);   // before paint, blocks
useEffect(() => subscribe(), []);      // after paint, does not

What to notice

← Back to the question list