{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-mounted-effect",
  "title": "useMountedEffect",
  "description": "A hook to run an effect only after the component is mounted",
  "files": [
    {
      "path": "registry/hooks/use-mounted-effect.ts",
      "content": "'use client'\n\nimport * as React from 'react'\n\nexport function useMountedEffect(\n  effect: React.EffectCallback,\n  deps: React.DependencyList = [],\n) {\n  const isMounted = React.useRef(false)\n\n  const effectEvent = React.useEffectEvent(effect)\n\n  React.useEffect(() => {\n    if (isMounted.current) {\n      return effectEvent()\n    }\n    isMounted.current = true\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, deps)\n}\n",
      "type": "registry:hook",
      "target": "hookas/use-mounted-effect.ts"
    }
  ],
  "type": "registry:hook"
}