1.0.13 • Published 4 years ago

@jacob-hooks/use-confirm v1.0.13

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

@jacob-hooks/use-confirm

React Hook to ask the user for a confirmation before executing a function.

installation

yarn

yarn add @jacob-hooks/use-confirm

npm

npm i @jacob-hooks/use-confirm

Usage

import React from "react";
import useConfirm from "@jacob-hooks/use-confirm";

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

Arguments

ArgumentTypeDescriptionRequired
confirmfunctionTo ask the user for a confirmation before executing a function.yes
1.0.13

4 years ago

1.0.12

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago