My simple example to show how to structure a React Native app with createDrawerNavigator and createStackNavigator (from react-navigation).
App walkthrough:
For ease of understanding, code components are all in App.js!
- The TouchableMenuIcon will always be displayed on the top-left hand side of the app
- Touching the menu icon opens up the SideMenu which you can style however you want
- A navigation stack RootStack holds the 3 screens in this example
- MyDrawerNavigator wraps the root stack and makes the side menu show up!
Setup commands:
- npm install react-navigation --save
- npm install
- react-native run-ios
I went through a lot of other examples (many which didn't work as of July 2018) to come up with this one. Hopefully it will work when you try it out!