maks-akymenko / react-burger-menu-article-app

React app with implemented hamburger menu

Home Page:https://codepen.io/maximakymenko/pen/aboWJpX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Menu Component - isHidden

Lulololu opened this issue · comments

Hello,

First, thanks a lot for your Burger Menu. It's nice and well done. I have this little question about the isHidden value.

If the menu is Open, then isHidden is true, so Menu Items tabIndex is 0.
But if the menu isHidden, why would be the items inside it be 0 ?

Would it not be more logical to hace an isDisplayed value instead of isHidden ?

-->

`const Menu = ({ open, ...props }) => {

const isMenuDisplayed = open ? true : false;
const tabIndex = isMenuDisplayed ? 0 : -1;

return (
<StyledMenu open={open} aria-hidden={!isMenuDisplayed} {...props}>


)
}`

Thank you.