Ionic 5 React - Show Side Menu Only On Some Pages

How can I prevent the side menu from being draggable into view in some pages?

Calling menuController.enable(false, "main") doesn’t work properly because it immediately makes the menu disappear instead of closing it with the appropriate animation. And there is no way to set up a callback for when the menu is closed.

Basically I want to scope my menu to a page and its descendants. How can I do that?

when you load the specific page component is the menu should be disabled then disable it, I would suggest using a global state object to manage that.

see this Compile stuck bug IonMenuToggle wrap withRouter

1 Like