← React Intermediate Questions - Set 1 Q3

What is the difference between useEffect and useLayoutEffect?

React Intermediate Questions - Set 1

Example

useLayoutEffect(() => { /* measure, runs before paint */ }, []);
useEffect(() => { /* fetch, runs after paint */ }, []);

What to notice

← Back to the question list