diff --git a/src/hooks/usePageLeave/usePageLeave.ts b/src/hooks/usePageLeave/usePageLeave.ts index 3aa6c0b1..77a56bf8 100644 --- a/src/hooks/usePageLeave/usePageLeave.ts +++ b/src/hooks/usePageLeave/usePageLeave.ts @@ -6,10 +6,11 @@ import { useEvent } from '../useEvent/useEvent'; * @name usePageLeave * @description - Hook what calls given function when mouse leaves the page * - * @param {() => void} callback The callback function what calls then mouse leaves the page + * @param {() => void} [callback] The callback function what calls then mouse leaves the page + * @returns {boolean} A boolean which determines if the mouse left the page * * @example - * usePageLeave(() => console.log('on leave')) + * const isLeft = usePageLeave(() => console.log('on leave')) */ export const usePageLeave = (callback?: () => void) => { const [isLeft, setIsLeft] = React.useState(false);