NavigationActions and Redux Integration
I noticed in the ReduxExample (which I was unable to get running) on line 25 of AuthButton.js an action is set up to dispatch like so.
loginScreen: () =>
dispatch(NavigationActions.navigate({ routeName: 'Login' }))
However this action does not make sense. Since the action being dispatched is of type Navigation/NAVIGATE, this will not result in the state changing since the reducer is not listening for a Navigation/NAVIGATE action. Why is this in the example? Who is listening for this dispatched action and how does it change the state if the reducer is not listening for it?
Thanks.
I believe this action will fall through to the default branch of the switch statement in the nav reducer.
The call to AppNavigator.router.getStateForAction(action, state) will produce the new nav state.
https://github.com/react-community/react-navigation/blob/master/examples/ReduxExample/src/reducers/index.js#L31
Ah, that makes sense. Thank you!