I have a Login Page(StackNavigator) and a Tabbed pages(TabNavigator).
export const Root = StackNavigator({ LoginScreen: {screen: Login}, Tabs: {screen: Tabs} }, { initialRouteName: 'LoginScreen' } )
After logging the user in there is still a possibility for the user to go back(to Login Page) by swiping back. What is the way of popping the login route from the Route Stack or disabling the back swipe option. Thanks
Advertisement
Answer
Dispatch a reset action instead of the normal navigation dispatch. That way you can set the stack to the state you want it to be after logging in and remove your LoginScreen
from the stack.
Example related answers: