import {useEffect, useState} from "react"; export default function Dropdown(props) { const [ open, setOpen ] = useState(false); useEffect( () => { document.addEventListener('keyup', (e) => { if (e.key === "Escape") { setOpen(false); } }); }, [open]); return (