|
Download react-use/docs/usePageLeave.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 240 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/usePageLeave.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/usePageLeave.md
-
curl -L -o usePageLeave.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/usePageLeave.md
240 Bytes
| # `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; | |
| }; | |
| ``` | |