# @types/react-beforeunload

> TypeScript definitions for react-beforeunload

Latest version **2.1.5** (published 2023-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-beforeunload
pnpm add @types/react-beforeunload
yarn add @types/react-beforeunload
bun add @types/react-beforeunload
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.5 |
| Published | 2023-12-30 |
| First published | 2019-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51476 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-beforeunload
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-beforeunload
- npm.io page: https://npm.io/package/@types/react-beforeunload

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 2.1.5 (latest) — 2023-12-30
- 2.1.4 (ts4.5) — 2023-11-07
- 2.1.1 (ts3.6) — 2021-07-08
- 2.1.0 (ts2.8) — 2019-06-28
- 2.1.3 — 2023-10-18
- 2.1.2 — 2023-09-27

## README

# Installation
> `npm install --save @types/react-beforeunload`

# Summary
This package contains type definitions for react-beforeunload (https://github.com/jacobbuck/react-beforeunload#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-beforeunload.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-beforeunload/index.d.ts)
````ts
import * as React from "react";

export type UseBeforeunloadHandler = ((arg: Event) => string | undefined) | ((arg: Event) => void);

export function useBeforeunload(handler?: UseBeforeunloadHandler): void;

export const Beforeunload: React.FC<{
    children?: React.ReactNode | undefined;
    onBeforeunload: UseBeforeunloadHandler;
}>;

````

### Additional Details
 * Last updated: Sat, 30 Dec 2023 14:07:00 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [nem035](https://github.com/nem035).

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