usePageLeaveReact sensor hook that fires a callback when mouse leaves the page.
import {usePageLeave} from 'react-use';
const Demo = () => {
usePageLeave(() => console.log('Page left...'));
return null;
};
// TODO: implement usePageLeave function notImplemented(..._args: any[]): any { throw new Error('Not implemented'); } export default notImplemented; export const usePageLeave = notImplemented;
Tests