useUnmount React lifecycle hook that call unmount callback, when component is un-mounted. Usage import {useUnmount} from 'react-use'; const Demo = () => { useUnmount(() => console.log('UNMOUNTED')); return null; }; Reference useUnmount(mount);