Newer
Older
import { createPortal } from 'react-dom';
const root = document.getElementById('root') ?? document.getElementsByTagName('html')[0];
interface Props {
children: ReactNode
onClose: Function
}
export default function Popup({ children, onClose }: Props) {
document.addEventListener('keydown', (e) => {
<div className="popup">
{children}
</div>
<div className="background" onClick={() => onClose()}></div>