Size0.20 kbView sourceuseUnmountEffectExecute the callback when the component unmounts (cleanup effect).Installation npmpnpmyarnbunnpm install @1hook/use-unmount-effect Usage import { useUnmountEffect } from '@1hook/use-unmount-effect' Execute a function on unmount: useUnmountEffect(() => console.log('Unmounted!'))useTimeoutsetTimeout, reactified.useUpdateEffectuseEffect without the initial effect.