@loyhooks/use-before-leave
React Hook to execute a function when the mouse leaves the page. Useful to show a popup or for analytics.
Installation
yarn
yarn add @loyhooks/use-before-leave
npm
npm i @loyhooks/use-before-leave
Usage
;; { const beforeLeave = console; ; return <h1>Hello Nooks</h1>;}
Arguments
Argument | Type | Description | Required |
---|---|---|---|
onBeforeLeave | function | Function to be called when the mouse leaves the document | yes |