Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//routes.js
import { createStackNavigator, createSwitchNavigator, createAppContainer } from 'react-navigation';
import SignIn from './screens/SignIn';
import Home from './screens/Home';
const AuthNavigator = createStackNavigator({
SignIn,
});
const AppNavigator = createStackNavigator({
Home,
});
const Router = createAppContainer(createSwitchNavigator(
{
Auth: AuthNavigator,
App: AppNavigator,
},
{
initialRouteName: 'Auth',
},
));
export default Router;
// index.js
import Router from './routes';
...
<Router>
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment