From eeda63fb3e088753bf243d1d32cd4900c96d7246 Mon Sep 17 00:00:00 2001 From: Tom Aranda Date: Sat, 9 Sep 2017 11:13:32 -0500 Subject: [PATCH] Update top-level component nav documentation (#2543) The code example listed in the current documentation results in a deprecation warning. This update should work. --- docs/api/navigators/Navigators.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/navigators/Navigators.md b/docs/api/navigators/Navigators.md index ff13df59..8bac53cd 100644 --- a/docs/api/navigators/Navigators.md +++ b/docs/api/navigators/Navigators.md @@ -24,12 +24,16 @@ To learn how to create screens, read about: In case you want to use Navigator from the same level you declare it you can use react's [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html#the-ref-callback-attribute) option: ```js +import { NavigationActions } from 'react-navigation'; + const AppNavigator = StackNavigator(SomeAppRouteConfigs); class App extends React.Component { someEvent() { // call navigate for AppNavigator here: - this.navigator && this.navigator.dispatch({ type: 'Navigate', routeName, params }); + this.navigator && this.navigator.dispatch( + NavigationActions.navigate({ routeName: someRouteName }) + ); } render() { return (