useMount
A hook that executes a function after the component is mounted.
Overview
A hook that executes a function after the component is mounted.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMount.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMount.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMount.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useMount.jsonA hook that executes a function after the component is mounted.
Examples
Default Usage
API
useMount(fn: EffectCallback);Params
| Property | Description | Type | Default |
| -- | ---- |
| fn | The function to be executed | EffectCallback | - |