Both run effects, but at different moments relative to the browser paint — and that timing difference is the whole point.
useEffectruns after the browser has painted. It's asynchronous and non-blocking. Use it for almost everything (data, subscriptions, logging).useLayoutEffectruns synchronously after the DOM is mutated but BEFORE the browser paints. Use it when you must read layout and change the DOM in the same frame to avoid a visible flicker.
