Closed KevinGrandon closed 9 years ago
All children of the SideMenu are passed menuActions
as props so if its a child / descendent it can use this.props.menuAction.toggleMenu
https://github.com/Kureev/react-native-side-menu/blob/master/index.js#L249-L253
Sup Jordan! Yeah, that works for me - I mainly needed to be able to control this from an external component, not a child, but I figured out how to do that. Might want to update the readme, but can probably close this.
I really need to move it to context
instead of this hack.
I have a button which I would like to control the menu with, but I'm not sure of the suggested way to open/collapse the menu from an external component. Is there a way to get the ref and call a .toggle() on the menu?
Edit - seems the solution is pretty simple, you just need something like:
I would still recommend putting something into the README about this.