Skip to content

Instantly share code, notes, and snippets.

@BenFausch
Created December 20, 2017 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenFausch/59ea29395d5a806cb1a0fbb0866acfcb to your computer and use it in GitHub Desktop.
Save BenFausch/59ea29395d5a806cb1a0fbb0866acfcb to your computer and use it in GitHub Desktop.
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