mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
16 lines
240 B
Markdown
16 lines
240 B
Markdown
# `usePageLeave`
|
|
|
|
React sensor hook that fires a callback when mouse leaves the page.
|
|
|
|
## Usage
|
|
|
|
```jsx
|
|
import {usePageLeave} from 'react-use';
|
|
|
|
const Demo = () => {
|
|
usePageLeave(() => console.log('Page left...'));
|
|
|
|
return null;
|
|
};
|
|
```
|