arrow_backBACK TO DRILLS
Black BeltuseeffectPREMIUM
useLayoutEffect vs useEffect for Synchronous DOM Operations
A component measures a DOM element's position with getBoundingClientRect() and uses that measurement to set inline styles before the user sees anything. Why must this logic go in useLayoutEffect rather than useEffect?