@am-hooks/use-confirm
v1.0.0
Published
When the user clicks the delete button, show the message before firing the event
Downloads
4
Readme
useConfirm
사용자가 삭제 버튼을 클릭하는 작업을 하면 이벤트를 실행하기 전 메시지 보여주기
Installation
yarn
yarn add @am-hooks/use-confirm
npm
npm i @am-hooks/use-confirm
Usage
import useConfirm from "@am-hooks/use-confirm";
const App = () => {
const deleteWorld = () => console.log("onConfirm");
const abort = () => console.log("onCancel");
const confirmDelete = useConfirm("Are you sure?", deleteWorld, abort);
return <button onClick={confirmDelete}>Delete the world</button>;
}