Closed sohinim98 closed 4 years ago
Basically something to wrap the .bm-burger-button
class in.
Hey @sohinim98, the best way to achieve this is probably to disable the default burger icon with <Menu customBurgerIcon={ false } />
(more info here: https://github.com/negomi/react-burger-menu#custom-icons).
Then you can trigger the menu open/close state on clicks from your custom header/icon/whatever you want to use in place of the burger icon.
Don't try to wrap the menu inside the header, but instead structure it like:
<div>
<header> // Make this fixed
<YourCustomButton onClick={...call function to toggle menu here...} />
</header>
<Menu
customBurgerIcon={false}
...other props go here...
>
...menu contents go here...
</Menu>
</div>
Works perfectly! Thanks :)
Want the react-hamburger-menu icon to be in a container (like a header with 100% width with a solid background color) that has the same behaviour as the hamburger icon. Tried it by wrapping a fixed div around it first to get started, but that doesn't seem to work.
CSS -
Was wondering if there is an inbuilt class/id I can use.