{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "use-isomorphic-layout-effect", "description": "A custom hook that works like useLayoutEffect but is compatible with server-side rendering.", "files": [ { "path": "src/registry/new-york/hooks/use-isomorphic-layout-effect.ts", "content": "import { useEffect, useLayoutEffect } from \"react\";\n\n/**\n * A custom hook that provides a cross-platform compatible `useLayoutEffect`.\n * It uses `useEffect` on the server and `useLayoutEffect` on the client.\n * @param {Function} effect - The effect function to run.\n * @param {Array} deps - The dependencies array for the effect.\n * @returns {void}\n */\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n", "type": "registry:hook" } ], "type": "registry:hook" }