# @ian_test_nooks/use-beforeleave

> React Hook to check mouse position when mouse leave element or area

Latest version **1.0.2** (published 2021-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ian_test_nooks/use-beforeleave
pnpm add @ian_test_nooks/use-beforeleave
yarn add @ian_test_nooks/use-beforeleave
bun add @ian_test_nooks/use-beforeleave
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-04-19 |
| First published | 2021-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | AZSquad.co |
| Maintainers | iian |
| Keywords | react, hook, beforeLeave |

## Links

- npm: https://www.npmjs.com/package/@ian_test_nooks/use-beforeleave
- Repository: https://github.com/azsquadDev/Nooks
- Homepage: https://github.com/azsquadDev/Nooks#readme
- Issues: https://github.com/azsquadDev/Nooks/issues
- npm.io page: https://npm.io/package/@ian_test_nooks/use-beforeleave

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^17.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-04-19
- 1.0.1 — 2021-04-19
- 1.0.0 — 2021-04-19

## README

# @ian_test_nooks/use-beforeleave

React Hook to check mouse position when mouse leave element or area

```
npm i @ian_test_nooks/use-beforeleave
```

useBeforeLeave(callback function after mouse leave);
..
const { clientY } = event;
    if (clientY <= 0) {
      onBefore();
    }
..
```
import useBeforeLeave from "@ian_test_nooks/use-beforeleave";

const App = () => {
  const begForLife = () => console.log("Please dont leave");
  useBeforeLeave(begForLife);

  return (
    <div className="App">
      <div>Hi</div>
    </div>
  );
};
```

---
_Source: https://npm.io/package/@ian_test_nooks/use-beforeleave · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
