Closed morellan closed 5 years ago
When navigating without the navigation props, according to the docs the navigator reference has a method dispatch.
dispatch
In the createAppContainer method of react-navigation-native exists, but in react-navigation-web the method is called _dispatch.
createAppContainer
react-navigation-native
react-navigation-web
_dispatch
One way to solve it is using the Platform component of react-native/react-native-web like:
Platform
const action = NavigationActions.navigate({ routeName, params }); if (Platform.OS === "web") { navigatorRef._dispatch(action); } else { navigatorRef.dispatch(action); }
This PR attempts to maintain consistency between the navigator API and the docs.
Saw the failed checks and I guess they have to do with the CircleCI config:
👍 Looks great to me.
LGTM
@ericvicenti - deploy at your leisure :)
When navigating without the navigation props, according to the docs the navigator reference has a method
dispatch
.In the
createAppContainer
method ofreact-navigation-native
exists, but inreact-navigation-web
the method is called_dispatch
.One way to solve it is using the
Platform
component of react-native/react-native-web like:This PR attempts to maintain consistency between the navigator API and the docs.