Skip to main content

설치

설치하기

npm install --save @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>
);
}