Instantly share code, notes, and snippets.

Embed
What would you like to do?
Side navigation for React Native Router Flux v4, using drawer, opens and closes with button
//been trying to find an example with RNRF that has a drawer that can be opened and closed with a
//button, and responds in the same way as v3
//it's been impossible to find this anywhere in the docs, so here's a few snippets to help out
//so here you have your new basic nav router setup:
<Router>
<Scene key='root'>
<Drawer
hideNavBar
key="drawer"
contentComponent={DrawerContent}
drawerWidth={300}
>
<Scene key='drawerChildrenWrapper'>
//etc...
/*
this problem came up, unlike v3 where you can create a <Scene> with an open={false} parameter that can be managed by
component state, and the event can be triggered by Actions.refresh({open:true})
You now have the React Navigation built
<Drawer>
This component has a special feature that can be triggered by the magic actions:
Actions.drawerOpen()
Actions.drawerClose()
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment