I use React Navigation with Redux in React Native. Navigation is working fine, but on one screen the goBack() function doesn't work. Can you tell we why?
This is the header config:
static navigationOptions = {
header: ({ state, goBack }) => {
return {
title: state.params.name,
right: (<Button
title={'Done'}
onPress={() => goBack()}
/>)
}
}
}
This is the dispatched event:
No Screen is poped off. The Screen on the device stays the same.
Try
<Button onPress={() => this.props.navigation.goBack(null)}>
when null is used as input parameter it will bring you to the last page(immediate history) and it helps in situations where nested StackNavigators to go back on a parent navigator when the child navigator already has only one item in the stack.
They may change in future because according to their documentation there are planning to change it.
For more information check here .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With