React Native error redirecting to Homepage after user login

You cannot navigate to a screen outside the current navigator like that.

It is recommended that you use the authentication flow in the react navigation docs here:

It uses conditional operations to change the navigator, instead of directly navigating to a screen.

For Example:

isSignedIn ? (
    <Stack.Screen name="Home" component={HomeScreen} />
    <Stack.Screen name="Profile" component={ProfileScreen} />
    <Stack.Screen name="Settings" component={SettingsScreen} />
) : (
    <Stack.Screen name="SignIn" component={SignInScreen} />
    <Stack.Screen name="SignUp" component={SignUpScreen} />


CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top