import React, { Fragment } from "react";
import "./index.scss";
import * as ReactDOM from "react-dom";
interface Props {
visible?: boolean;
onClose?: () => void;
children?: any;
}
const Modal = ({ visible, onClose, children }: Props) => {
return (
visible &&
ReactDOM.createPortal(
<Fragment>
<div className={"modal-wrap"}>
<div>{children}</div>
</div>
</Fragment>,
document.body
)
);
};
export default Modal;