mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
24 lines
289 B
Markdown
24 lines
289 B
Markdown
# `useUnmount`
|
|
|
|
React lifecycle hook that call `unmount` callback, when
|
|
component is un-mounted.
|
|
|
|
|
|
## Usage
|
|
|
|
```jsx
|
|
import {useUnmount} from 'react-use';
|
|
|
|
const Demo = () => {
|
|
useUnmount(() => console.log('UNMOUNTED'));
|
|
return null;
|
|
};
|
|
```
|
|
|
|
|
|
## Reference
|
|
|
|
```js
|
|
useUnmount(mount);
|
|
```
|