Differences between this.props.navigation.dispatch vs this.props.navigation.navigate?
From github :
This is the code of navigate
function which reuses navigation.dispatch
.. And remember:
Code Don't Lie
Then, navigation.navigate(...args)
is an alias of navigation.dispatch(NavigationActions.navigate(...args))
From the React Navigation docs The Navigation Prop chapter (https://reactnavigation.org/docs/navigators/navigation-prop#dispatch-Send-an-action-to-the-router):
...The other navigation functions use dispatch behind the scenes...
Also parameters for NavigationActions.navigate
and this.props.navigation.navigate
are the same. There should be no difference which one you use. In my opinion, this.props.navigation.navigate
is shorter and more readable.