Shadcn Hooks

useUpdateEffect

A hook to run an effect only when the component updates

Installation

npx shadcn@latest add @shadcnhooks/use-update-effect

API

/**
 * A hook to run an effect only when the component updates
 * @param effect - The effect to run
 * @param deps - The dependencies to run the effect on
 */
export function useUpdateEffect(
  effect: EffectCallback,
  deps: DependencyList,
): void

Credits

Last updated on

On this page