react-navigation / web

Tools for react-navigation on web browsers and servers
https://reactnavigation.org
MIT License
94 stars 28 forks source link

Rename _dispatch to dispatch for API consistency #19

Closed morellan closed 5 years ago

morellan commented 5 years ago

When navigating without the navigation props, according to the docs the navigator reference has a method dispatch.

In the createAppContainer method of react-navigation-native exists, but in react-navigation-web the method is called _dispatch.

One way to solve it is using the Platform component of react-native/react-native-web like:

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.

morellan commented 5 years ago

Saw the failed checks and I guess they have to do with the CircleCI config:

ericvicenti commented 5 years ago

👍 Looks great to me.

slorber commented 5 years ago

LGTM

brentvatne commented 5 years ago

@ericvicenti - deploy at your leisure :)