{ "name": "use-lazy-ref", "type": "registry:hook", "files": [ { "path": "hooks/use-lazy-ref.ts", "type": "registry:hook", "content": "import * as React from \"react\";\n\nfunction useLazyRef(fn: () => T) {\n const ref = React.useRef(null);\n\n if (ref.current === null) {\n ref.current = fn();\n }\n\n return ref as React.RefObject;\n}\n\nexport { useLazyRef };\n", "target": "" } ] }