use-before-unload3
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

use-before-unload3

React side-effect hook that shows browser alert when user try to reload or close the page.

Installation

To install the package, use npm:

pnpm add use-before-unload3

yarn install use-before-unload3

npm install use-before-unload3

Usage

import { useBeforeUnload } from 'use-before-unload3';

useBeforeUnload('Message');

tsup

Bundle your TypeScript library with no config, powered by esbuild.

https://tsup.egoist.dev/

How to use this

  1. install dependencies
# pnpm
$ pnpm install

# yarn
$ yarn install

# npm
$ npm install
  1. Add your code to src
  2. Add export statement to src/index.ts
  3. Test build command to build src. Once the command works properly, you will see dist folder.
# pnpm
$ pnpm run build

# yarn
$ yarn run build

# npm
$ npm run build
  1. Publish your package
$ npm publish

test package

https://www.npmjs.com/package/use-before-unload3

/use-before-unload3/

    Package Sidebar

    Install

    npm i use-before-unload3

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    8.56 kB

    Total Files

    15

    Last publish

    Collaborators

    • dimetrix