설치
설치하기
- npm
- yarn
- pnpm
npm install --save @react-crates/modal
yarn add @react-crates/modal
pnpm add @react-crates/modal
요점
import React from "react";
import { generateModal, modalCollection } from "@react-crates/modal";
const { modalCtrl, ModalProvider } = generateModal({
...modalCollection,
});
function App() {
const alert = () => modalCtrl.alert("알림");
return (
<div>
<button onClick={alert}>알림</button>
<ModalProvider />
</div>
);
}