0.0.1 • Published 3 years ago
navi-react-component v0.0.1
react-common-component
背景
Install
npm install react-open-modal -S
Usage
import ReactOpenModal from "react-open-modal";
import s from "./index.less";
function ModalTest({ onClose }) {
return (
<div
onClick={() => {
console.log("close");
onClose?.();
}}
>
this is test dialog
</div>
);
}
export default function IndexPage() {
const handleClick = () => {
ReactOpenModal(<ModalTest />);
};
return (
<div>
<h1 className={s.title} onClick={handleClick}>
Page index
</h1>
</div>
);
}
License
MIT
0.0.1
3 years ago