0.1.0 • Published 5 years ago

prevent-browser-tab-closing v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

prevent-browser-tab-closing

With this little library, you can notify your users if they have unsaved changes before accidentally closing the browser or its tab.

How to use:

npm i prevent-browser-tab-closing or yarn add prevent-browser-tab-closing

then import it at where-ever you want to prevent user from accidentally closing the browser tab.

import confirmTabClosing from "prevent-browser-tab-closing" or
import { confirmTabClosing } from "prevent-browser-tab-closing"