@nooks_seo/use-confirm
v1.0.0
Published
React Hook to ask for user confirmation before executing an action
Downloads
3
Readme
@nooks_seo/use-confirm
React Hook to ask for user confirmation before executing an action
설치
npm install @nooks_seo/use-confirm
# 또는
yarn add @nooks_seo/use-confirm사용 방법
import React from "react";
import { useConfirm } from "@nooks_seo/use-confirm";
function App() {
const deleteWorld = () => console.log("Deleting the world...");
const abort = () => console.log("Aborted!");
const confirmDelete = useConfirm(
"Are you sure you want to delete the world?",
deleteWorld,
abort
);
return (
<div>
<button onClick={confirmDelete}>Delete World</button>
</div>
);
}
export default App;