React side-effect hook that shows browser alert when user try to reload or close the page.
To install the package, use npm:
``bash
pnpm add use-before-unload3
yarn install use-before-unload3
npm install use-before-unload3
`
`typescript
import { useBeforeUnload } from 'use-before-unload3';
useBeforeUnload('Message');
`
https://tsup.egoist.dev/
pnpm
$ pnpm installyarn
$ yarn installnpm
$ npm install
`
2. Add your code to src
3. Add export statement to src/index.ts
4. Test build command to build src.
Once the command works properly, you will see dist folder.`zsh
pnpm
$ pnpm run buildyarn
$ yarn run buildnpm
$ npm run build
`
5. Publish your package`zsh
$ npm publish
``