From f39f21660d2318997d3ca2fc52deaf50e47d62df Mon Sep 17 00:00:00 2001 From: r_fujiwara Date: Mon, 24 Jul 2017 11:27:42 -0700 Subject: [PATCH] Update Navigation.md Summary: NavigatorIOS push method arg is route object. For working this image animation, add passProps property to NavigationIOS, changed _onForward function navigator.push method arg is route object Closes https://github.com/facebook/react-native/pull/15178 Differential Revision: D5481399 Pulled By: hramos fbshipit-source-id: b131ef27b70fc0bbc4f519a924187c19dca73ed2 --- docs/Navigation.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/Navigation.md b/docs/Navigation.md index fd0dfb30b..36c2c08b2 100644 --- a/docs/Navigation.md +++ b/docs/Navigation.md @@ -99,6 +99,7 @@ export default class NavigatorIOSApp extends React.Component { initialRoute={{ component: MyScene, title: 'My Initial Scene', + passProps: {index: 1}, }} style={{flex: 1}} /> @@ -108,7 +109,9 @@ export default class NavigatorIOSApp extends React.Component { class MyScene extends React.Component { static propTypes = { - title: PropTypes.string.isRequired, + route: PropTypes.shape({ + title: PropTypes.string.isRequired + }), navigator: PropTypes.object.isRequired, } @@ -116,10 +119,13 @@ class MyScene extends React.Component { super(props, context); this._onForward = this._onForward.bind(this); } - + _onForward() { + let nextIndex = ++this.props.index; this.props.navigator.push({ + component: MyScene, title: 'Scene ' + nextIndex, + passProps: {index: nextIndex} }); }