usePageLeave ​
Hook what calls given function when mouse leaves the page
typescript
import { usePageLeave } from '@siberiacancode/reactuse';
Usage ​
typescript
const isLeft = usePageLeave(() => console.log('on leave'))
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
callback? | () => void | - | The callback function what calls then mouse leaves the page |
Returns
boolean