{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "native-internal-hook-use-augmented-ref", "type": "registry:hook", "title": "Use Augmented Ref", "description": "Use Augmented Ref from @pitsi-ui/native for native projects.", "dependencies": [], "registryDependencies": [], "files": [ { "path": "registry/native-ui/src/helpers/internal/hooks/use-augmented-ref.ts", "content": "import type * as React from \"react\";\nimport { useImperativeHandle, useRef } from \"react\";\n\ninterface AugmentRefProps {\n ref: React.Ref;\n methods?: Record any>;\n deps?: any[];\n}\n\nexport function useAugmentedRef({ ref, methods, deps = [] }: AugmentRefProps) {\n const augmentedRef = useRef(null);\n\n useImperativeHandle(\n ref,\n () => {\n if (typeof augmentedRef === \"function\" || !augmentedRef?.current) {\n return {} as T;\n }\n return {\n ...augmentedRef.current,\n ...methods,\n };\n },\n // biome-ignore lint/correctness/useExhaustiveDependencies: deps are caller-controlled\n deps,\n );\n return augmentedRef;\n}\n", "type": "registry:hook", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/hooks/use-augmented-ref.ts" } ], "categories": [ "native", "react-native", "internal-hooks" ], "meta": { "package": "@pitsi-ui/native", "packageSlug": "native-ui", "platform": "native" } }