useOnUnmount
Run a callback after a component unmounts using the useOnUnmount hook.
The useOnUnmount
hook is helpful when you want to run a callback function after the component has unmounted. It relies on the React.useEffect()
hook internally.
useOnUnmount
Unmounted: 0 time
Usage
Import the hook from @abhushanaj/react-hooks
and use in required component;
API Reference
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
callback | ()=>void | The callback function to run after component unmount. | N/A |