useEffectEvent
A hook to declare an effect event
Installation
If you are using React 19.2, please use the built-in useEffectEvent instead.
npx shadcn@latest add @shadcnhooks/use-effect-eventAPI
/**
* A hook to declare an effect event
* @param fn - The function to declare as an effect event
* @returns The function declared as an effect event
*/
export function useEffectEvent<const T extends (...args: any[]) => void>(
fn: T,
): TCredits
Last updated on