Last active
August 6, 2020 13:46
-
-
Save markodayan/a4a699758063367667b38385824f9eb5 to your computer and use it in GitHub Desktop.
advanced App.js for Multiple RN Navigation Options
This file contains hidden or 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
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
// React Navigation | |
import { createAppContainer, createSwitchNavigator } from 'react-navigation'; | |
import { createStackNavigator } from 'react-navigation-stack'; | |
import { createBottomTabNavigator } from 'react-navigation-tabs'; | |
// Screen | |
import AccountScreen from './src/screens/AccountScreen'; | |
import DashboardScreen from './src/screens/DashboardScreen'; | |
import IndexScreen from './src/screens/IndexScreen'; | |
import SignInScreen from './src/screens/SignInScreen'; | |
import SignUpScreen from './src/screens/SignUpScreen'; | |
import UpdateDetailsScreen from './src/screens/UpdateDetailsScreen'; | |
const switchNavigator = createSwitchNavigator({ | |
loginFlow: createStackNavigator({ | |
SignUp: SignUpScreen, | |
SignIn: SignInScreen, | |
}), | |
mainFlow: createBottomTabNavigator({ | |
userDetailsFlow: createStackNavigator({ | |
Dashboard: DashboardScreen, | |
UpdateDetails: UpdateDetailsScreen, | |
}), | |
Account: AccountScreen, | |
}), | |
}); | |
const App = createAppContainer(switchNavigator); | |
export default () => { | |
return <App />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment