useLifecyclesReact lifecycle hook that call mount and unmount callbacks, when
component is mounted and un-mounted, respectively.
import {useLifecycles} from 'react-use';
const Demo = () => {
useLifecycles(() => console.log('MOUNTED'), () => console.log('UNMOUNTED'));
return null;
};
useLifecycles(mount, unmount);
// TODO: implement useLifecycles function notImplemented(..._args: any[]): any { throw new Error('Not implemented'); } export default notImplemented; export const useLifecycles = notImplemented;
Tests