useLayoutEffect is a specialized tool for work that must happen before paint. Most effects should remain useEffect.