title: createSwitchNavigator with React Navigation v5?
body: <p>I my old version I make something like this:
  going to splash screen, if user is connected go to App, else go to login.</p>
  <p>And I can navigate into screen by using <code>this.props.navigation.navigate(&quot;Register&quot;)</code></p>
  <p>SplashScreen.js :</p>
  <pre class="lang-js prettyprint-override"><code>    componentDidMount(){
          firebase.auth().onAuthStateChanged(user =&gt; {
              this.props.navigation.navigate(user ? &quot;App&quot; : &quot;Login&quot;)
          });
      }
  </code></pre>
  <p>in App.js</p>
  <pre class="lang-js prettyprint-override"><code>const Container = createAppContainer(
      createSwitchNavigator(
          {
              Splash: SplashScreen,
              Login: LoginScreen,
              Register: RegisterScreen,
              App: AppContainer,
          },
          {
              initialRouteName: &quot;Splash&quot;,
          }
      )
  );
  
  //Other code
  
      render(){
          return (&lt;Container/&gt;)
      }
  </code></pre>
  <p>Now I try to use react Navigation v5 but everything seem to be more complicated.</p>
  <p>My App.js look like this :</p>
  <pre class="lang-js prettyprint-override"><code>export default function App() {
      const [isDarkTheme, setIsDarkTheme] = React.useState(false);
  
      const theme = isDarkTheme ? CombinedDarkTheme : CombinedDefaultTheme; // Use Light/Dark theme based on a state
  
      function toggleTheme() {
          // We will pass this function to Drawer and invoke it on theme switch press
          setIsDarkTheme(isDark =&gt; !isDark);
      }
  
      return (
          &lt;PaperProvider theme={theme}&gt;
              &lt;NavigationContainer theme={theme}&gt;
                  &lt;Drawer.Navigator
                      drawerContent={props =&gt; &lt;DrawerContent {...props} toggleTheme={toggleTheme}/&gt;}
                  &gt;
                      &lt;Drawer.Screen
                          name=&quot;HomeDrawer&quot;
                          component={MainTabScreen}
                      /&gt;
                      &lt;Drawer.Screen
                          name=&quot;SettingsScreen&quot;
                          component={SettingsStackScreen}
                      /&gt;
                  &lt;/Drawer.Navigator&gt;
              &lt;/NavigationContainer&gt;
          &lt;/PaperProvider&gt;
      );
  }
  </code></pre>
  <p>How I'm suppose to do something like this but with <code>PaperProvider</code> ?</p>