Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 240 Bytes

usePageLeave.md

File metadata and controls

15 lines (10 loc) · 240 Bytes

usePageLeave

React sensor hook that fires a callback when mouse leaves the page.

Usage

import {usePageLeave} from 'react-use';

const Demo = () => {
  usePageLeave(() => console.log('Page left...'));

  return null;
};