I have react-navigation setup with redux. My app consists of a parent TabBarNavigator with a login and content screen. The content Screen is itself a Stack Navigator that contains the main nav for the app. All other aspects of the redux and navigators work as expected, but the default back button on the StackNavigator also triggers it's parent TabBarNavigator to go back.
Is this expected behavior? I notice that if I define headerLeft in navigationOptions like this, it works as expected:
static navigationOptions = ({ navigation }) => {
return {
headerLeft: (
<Button transparent onPress={() => { navigation.goBack(); }}><Text>Back</Text></Button>
)
};
};
Cam anyone explain what causes this? Is there a way to make the default stackNavigator back button work with redux?
props.navigation.goBack(null). It's a bit handwavey, but this is what tipped me off to it: reactnavigation.org/docs/navigators/navigation-prop - mienaikoeprops.navigation.goBack(null)is not working for me. I would like to find a clean solution to use in the reducer. - Julien Malige