npm.io
1.0.1 • Published 6 years ago

@cooks/use-confirm

Licence
MIT
Version
1.0.1
Deps
0
Size
1 kB
Vulns
0
Weekly
0

@cooks/use-confirm

React Hook to update your document's confirm

example) useConfirm.js

const App = () => {
    const deleteWorld = () => console.log("Deleting the world...");
    const abort = () => console.log("Aborted");
    const confirmDelete = useConfirm("Are you sure", deleteWorld, abort);
    return (
        <button onClick={confirmDelete}>Delete the world</button>
    );
};

Keywords