npm

Need private packages and team management tools?Check out npm Orgs. »

@hookeasy/use-preventleave

1.0.0 • Public • Published

@hookeasy/use-preventleave

React Hook to update your preventleave event

install

npm i @hookeasy/use-preventleave

or

yarn add @hookeasy/use-preventleave

example

import React from "react";
import ReactDOM from "react-dom";
import usePreventLeave from "@hookeasy/use-preventleave";
 
const App = () => {
  const { enablePrevent, disablePrevent } = usePreventLeave();
 
  return (
    <div className="App">
        <button onClick={enablePrevent}>protect</button>
        <button onClick={disablePrevent}>unprotect</button>
    </div>
  );
};
 
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
 

install

npm i @hookeasy/use-preventleave

Downloadsweekly downloads

2

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability