import React, {useState} from 'react' import ReactDOM from 'react-dom' import styles from './style.module.css' interface Props { node: HTMLDivElement, children: any, stateChange?: Function, show?: boolean, title?: string } function Dialog({node, children, stateChange, show = false, title}: Props) { const [ishow, setIShow] = useState(false) const showChange = (show: boolean) => { setIShow(show) stateChange && stateChange(show) } if (show !== ishow) { setIShow(show) return null } const Layer = ishow ? (