@nooks_seo/use-before-leave
v2.1.0
Published
`useBeforeLeave` is a React Hook that executes a specified callback function when the user is about to leave the browser window (for example, when the mouse moves toward the top of the screen).
Downloads
6
Maintainers
Readme
@nooks_seo/use-before-leave
useBeforeLeave is a React Hook that executes a specified callback function when the user is about to leave the browser window (for example, when the mouse moves toward the top of the screen).
useBeforeLeave는 사용자가 브라우저 화면을 떠나려고 할 때(마우스가 창 상단으로 이동) 지정한 콜백 함수를 실행하는 React Hook입니다.
설치
npm install @nooks_seo/use-before-leave
# 또는
yarn add @nooks_seo/use-before-leave사용 방법
import React from "react";
import { useBeforeLeave } from "@nooks_seo/use-before-leave";
function App() {
const begForLife = () => console.log("Please don't leave!");
useBeforeLeave(begForLife);
return <h1>Don't go!</h1>;
}
export default App;