const [active, setActive] = useState(false);
function closeMenu(e) {
(e.keyCode === 9 && !e.shiftKey) && setActive(false);
}
view raw Dropdown.js hosted with ❤ by GitHub