How to toggle an IonMenu in ionic 6 react

Hi everybody,

how do you toggle an IonMenu in react from inside a function? I am aware of the IonMenuToggle component, but that only seems to work from within JSX by wrapping it around a button.
But I don’t want to do that, I just want to toggle a menu from within code, at best via the menuId.

I know that in earlier versions of ionic you could use the menuController to toggle a menu by Id, but after upgrading from ionic v5 to v6 this is apparently no longer possible (it just doesn’t work any more, no errors etc.)

Does anybody have any ideas?