I see a lot of folks in the react-navigation issues section using this.props.navigation.dispatch
to programmatically navigate. Is there any specific reason or use case to use that over this.props.navigation.navigate
?
It seems like you can pass more options to the dispatch function? Is there anything else? Can you use dispatch without explicitly tying react-navigation into your apps redux store? Right now I have an app that has redux, but I dont explicitly configure my redux setup to know about react-navigation (and would prefer to keep it that way if I can).
From github
From the React Navigation docs The Navigation Prop chapter (https://reactnavigation.org/docs/navigators/navigation-prop#dispatch-Send-an-action-to-the-router):
Also parameters for
NavigationActions.navigate
andthis.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.