Skip to content

usePageLeave ​

Category
Sensors

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

NameTypeDefaultNote
callback?() => void-The callback function what calls then mouse leaves the page

Returns

boolean

Contributors ​

Source • Demo