Closed greenymcgee closed 4 years ago
I'm also having this same problem
Hey @greenymcgee / @altruisticsoftware,
The callback you pass to .map
needs to return MenuItemComponent
in order for the props to be applied to it properly (not the div inside it), so you can do this instead:
someData.map(data => <MenuItemComponent {...data} />)}
Hello,
I'm currently working on a project where some nested menus have been requested in mobile view. Accomplishing this with
react-burger-menu
was pretty straightforward and works well overall, but I'm having some accessibility issues that I'm hoping we find a good solution for.I noticed that you can override where the
tabIndex
prop gets set to if you build a component for your menu items like this.The problem that I'm having though is when you pair this functionality with a loop like this:
Ideally the above scenario would work, but what happens instead is that the outermost
div
ofMenuItemComponent
gets thereact-burger-menu
props oftabIndex
,style
, andclassName
when coming from a loop.