Created
December 20, 2017 16:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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