use-page-leaveCall function when mouse leaves the pageImportimport { usePageLeave } from '@mantine/hooks';SourceView source codeDocsEdit this pagePackage@mantine/hooksUsageuse-page-leave calls given function when mouse leaves the page:Mouse left the page 0 timesimport { useState } from 'react';import { usePageLeave } from '@mantine/hooks'; function Demo() { const [leftsCount, setLeftsCount] = useState(0); usePageLeave(() => setLeftsCount((p) => p + 1)); return <>Mouse left the page {leftsCount} times</>;}Definitionfunction usePageLeave(onPageLeave: () => void): void;Go backuse-os – @mantine/hooksUp nextuse-text-selection – @mantine/hooksTable of contentsUsageDefinitionBuild fully functional accessible web applications faster than everAboutContributeAbout MantineChangelogReleasesCommunityChat on DiscordFollow on TwitterFollow on GithubGitHub discussionsProjectMantine UIDocumentationGithub organizationnpm organizationBuilt by Vitaly Rtishchev and these awesome peopleJoin Discord communityFollow Mantine on Twitter