ilokesto

useIsomorphicLayoutEffect

useIsomorphicLayoutEffect is useLayoutEffect on the client and useEffect on the server, preventing SSR warnings while preserving synchronous layout semantics.

import { useIsomorphicLayoutEffect } from '@ilokesto/utilinent/hooks';

function MeasureOnMount() {
  useIsomorphicLayoutEffect(() => measure(), []);
  return null;
}

On this page