usePageLeft
Calls given function when the mouse leaves the page
usePageLeft
calls given function when mouse leaves the page:
import { useState } from 'react';
import { usePageLeft } from 'hook-master-react';
function Demo() {
const [count, setCount] = useState(0);
usePageLeft(() => setLeftsCount((p) => p + 1));
return <div>Mouse left the page {count} times</div>;
}
function usePageLeft(onPageLeft: () => void): void;