You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
I would expect my action creators from ActionCreators to be bound to the navigation property, however they are not. The idea would be to use navigation.someCustomNavigationActionCreator() as opposed to binding navigation-related action creators to the AppNavigator Component itself (in which case I would be following the typical action creator flow of just calling someNavigationActionCreator().
I'm attempting this because I would prefer to follow the pattern of not explicitly using dispatch in my containers, which is how the documented example here is doing it: https://reactnavigation.org/docs/redux-integration.html
Is there not support for binding navigation-related action creators directly to the navigation prop? If so, am I doing something wrong here?
Thanks!
The text was updated successfully, but these errors were encountered:
Unfortunately there isn’t support for this now. The reason those action creators get dropped is because the code constructs “child” navigation props for child screens and navigators that have the state property set to the specific route. This code doesn’t bother to preserve all the navigation prop’s properties when making child navigation props, so your custom action creators get dropped.
Do you think we should support something like this? If so we would have to change the code in some places, so this would require a PR or an RFC on the main react-navigation package.
Sorry for bouncing you around between places. cc @brentvatne
When doing this:
<AppNavigator navigation={addNavigationHelpers({ dispatch, state: nav, addListener, ...bindActionCreators(ActionCreators, dispatch), })} />
I would expect my action creators from ActionCreators to be bound to the navigation property, however they are not. The idea would be to use navigation.someCustomNavigationActionCreator() as opposed to binding navigation-related action creators to the AppNavigator Component itself (in which case I would be following the typical action creator flow of just calling someNavigationActionCreator().
I'm attempting this because I would prefer to follow the pattern of not explicitly using dispatch in my containers, which is how the documented example here is doing it: https://reactnavigation.org/docs/redux-integration.html
Is there not support for binding navigation-related action creators directly to the navigation prop? If so, am I doing something wrong here?
Thanks!
The text was updated successfully, but these errors were encountered: