useMount
A hook to run a function when the component mounts
Installation
npx shadcn@latest add @shadcnhooks/use-mountAPI
type MountCallback = EffectCallback | (() => Promise<void | (() => void)>)
/**
* A hook to run a function when the component mounts
* @param fn - The function to run when the component mounts
* @returns The function to run when the component mounts
*/
export function useMount(fn: MountCallback): voidCredits
Last updated on