Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 278 Bytes

useUnmount.md

File metadata and controls

22 lines (14 loc) · 278 Bytes

useUnmount

当组件被卸载时,调用 unmount 回调的生命周期钩子。

用法

import {useUnmount} from 'react-use';

const Demo = () => {
  useUnmount(() => console.log('UNMOUNTED'));
  return null;
};

参考

useUnmount(mount);