{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-isomorphic-layout-effect",
  "title": "UseIsomorphicLayoutEffect",
  "description": "A hook that uses useLayoutEffect on the client and falls back to useEffect on the server to avoid SSR warnings.",
  "files": [
    {
      "path": "registry/hooks/use-isomorphic-layout-effect.tsx",
      "content": "'use client';\n\nimport {\n  DependencyList,\n  EffectCallback,\n  useEffect,\n  useLayoutEffect,\n} from 'react';\n\nexport function useIsomorphicLayoutEffect(\n  effect: EffectCallback,\n  deps?: DependencyList,\n): void {\n  const isBrowser =\n    typeof window !== 'undefined' && typeof window.document !== 'undefined';\n\n  const useIsomorphicEffect = isBrowser ? useLayoutEffect : useEffect;\n\n  useIsomorphicEffect(effect, deps);\n}\n",
      "type": "registry:hook",
      "target": "hooks/guarahooks/use-isomorphic-layout-effect.tsx"
    }
  ],
  "categories": [
    "lifecycle"
  ],
  "type": "registry:hook"
}