{
  "name": "use-latest",
  "author": "Brendan Dash (https://shadcn-hooks.com)",
  "description": "A hook to get the latest value of a variable",
  "registryDependencies": [
    "@shadcnhooks/use-isomorphic-layout-effect"
  ],
  "files": [
    {
      "path": "registry/hooks/use-latest.ts",
      "content": "import { useRef } from 'react'\nimport { useIsomorphicLayoutEffect } from '@/registry/hooks/use-isomorphic-layout-effect'\n\nexport function useLatest<T>(value: T) {\n  const ref = useRef(value)\n\n  useIsomorphicLayoutEffect(() => {\n    ref.current = value\n  })\n\n  return ref\n}\n",
      "type": "registry:hook"
    }
  ],
  "type": "registry:hook"
}
