{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-on-mount",
  "title": "UseOnMount",
  "description": "Executes a function only once when the component is mounted.",
  "files": [
    {
      "path": "registry/hooks/use-on-mount.tsx",
      "content": "'use client';\n\nimport { useEffect, useRef } from 'react';\n\nexport function useOnMount(callback: () => void): void {\n  const calledRef = useRef(false);\n\n  useEffect(() => {\n    if (!calledRef.current) {\n      callback();\n      calledRef.current = true;\n    }\n  }, []);\n}\n",
      "type": "registry:hook",
      "target": "hooks/guarahooks/use-on-mount.tsx"
    }
  ],
  "categories": [
    "lifecycle"
  ],
  "type": "registry:hook"
}