negomi / react-burger-menu

:hamburger: An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
http://negomi.github.io/react-burger-menu/
MIT License
5.05k stars 586 forks source link

Is there a way to preventDefault() on the click on the button? #278

Closed yeshwanthjagannath closed 6 years ago

yeshwanthjagannath commented 6 years ago

Is there a way to preventDefault() on the click on the menu button? If so how do can we override the e.preventDefault() method for the button click?

negomi commented 6 years ago

Hi @yeshwanthjagannath, the only way to do this currently would be to disable the default burger icon (see https://github.com/negomi/react-burger-menu#custom-icons) and trigger the menu from a custom button.

yeshwanthjagannath commented 6 years ago

Thanks for the response @negomi . I will give this a shot and let you know how it goes! Great nav lib BTW! Thank you for this!

negomi commented 6 years ago

No problem, good luck! :)