Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // App.js
  2. import { NavigationActions } from 'react-navigation';
  3. import AppNavigator from './navigation/AppNavigator';
  4.  
  5. <AppNavigator
  6.           ref={
  7.             (navigatorRef) => {
  8.               navigatorRef.dispatch(
  9.                 NavigationActions.navigate({
  10.                   routeName: 'Main',
  11.                 }),
  12.               );
  13.             }
  14.           }
  15.         />
  16.  
  17.  
  18.  
  19. // AppNavigator.js
  20. import MainTabNavigator from './MainTabNavigator';
  21. import AuthTabNavigator from './AuthTabNavigator';
  22.  
  23. export default createAppContainer(
  24.   createSwitchNavigator({
  25.     Main: MainTabNavigator,
  26.     Auth: AuthTabNavigator,
  27.   },
  28.   {
  29.     initialRouteName: 'Auth',
  30.   })
  31. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement