Skip to main content

useUnMount

a custom hook that calls a callback function when the component will unmount.


Interface

const useUnmount: (callback: () => any) => void

Usage

import { useUnmount } from '@devgrace/react';

const Example = () => {
useUnmount(() => console.log("unmount"));

return <>{/* ... */}</>;
};