1.0.0 • Published 4 years ago

@chooks/use-prevent-leave v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Usage

윈도우 창을 닫을 때 정말 닫을 것인지 확인한다.

export const App = () => {
    const { enablePrevent, disablePrevent } = usePreventLeave();
    return (
      <div>
        <button onClick={enablePrevent}>protect</button>
        <button onClick={disablePrevent}>unprotect</button>
      </div>
    );
  };
1.0.0

4 years ago