I am implementing a practice application in react-native for IOS. I am using NavigatorIOS for navigation. I want to remove first route from navigation stack after successful login so that user won't come back. I am using .replace()
function for this purpose and it replaces the route but navigation title remains unchanged.
Here are Images and related code to explain scenario.
Login screen
<NavigatorIOS
style={styles.container}
initialRoute={{
title: 'LOGIN',
component: LoginScreen
}}/>
After successful login app navigates to home screen which should have title 'HOME' as specified in code
this.props.navigator.replace({
title: 'HOME',
component: HomeScreen,
passProps: {token: responseData.token}
});
Next navigating to news, it still shows login on the back button.
I just used push()
method to push new view to stack.
Here is the main issue I am concerned with and cannot understand why this is happening. When is press back button viz '< LOGIN' it navigates to home screen and its title also changes to "HOME".
I do not get this behavior. Does anyone have idea why it is happening and how can I fix this thing. Help will be much appreciated.