@hooks/unmount
v0.1.0
Published
React hook execute a callback on component unmount
Downloads
3
Readme
🎒 @hooks/unmount
React hook execute a callback on component unmount
Install
npm i @hooks/unmount
Usage
useUnmount
useUnmount(callback: () => void, hook: (effect: EffectCallback, deps?: DependencyList) => void = useEffect)
Parameters
callback: () => void
Function to execute.
hook: (effect: EffectCallback, deps?: DependencyList) => void = useEffect
Hook to use, defaults to useEffect.