AsyncStorage
).SwitchNavigator
https://studentnew484.weebly.com/blog/spotify-app-for-calendars. yet. The purpose of SwitchNavigator
is to only ever show one screen at a time. By default, it does not handle back actions and it resets routes to their default state when you switch away. This is the exact behavior that we want from the authentication flow: when users sign in, we want to throw away the state of the authentication flow and unmount all of the screens, and when we press the hardware back button we expect to not be able to go back to the authentication flow. We switch between routes in the SwitchNavigator
by using the navigate
action. You can read more about the SwitchNavigator
in the API reference.initialRouteName
to 'AuthLoading'
because we will fetch our authentication state from persistent storage inside of that screen component.App
and Auth
routes are both stack navigators, but you could do whatever you like here. As mentioned above, you probably want your authentication route to be a stack for password reset, signup, etc. Similarly for your app, you probably have more than one screen. We won't talk about how to implement the text inputs and buttons for the authentication screen, that is outside of the scope of navigation. Free spotify on virgin media. We'll just fill in some placeholder content.createAnimatedSwitchNavigator
in the API reference.