Rename navigationState.children to navigationState.routes.

Summary:
[Experimental API breaking changes]

The notion of `parent` or `children` in navigaton is misleading. We have no intention to maintain or
build the nested or hierarchical navigation states. To be clear, rename `navigationState.children` to
`navigationState.route`.

Reviewed By: ericvicenti

Differential Revision: D3332115

fbshipit-source-id: c72ed08acaf030fb9c60abf22fb15cc0f44b3485
This commit is contained in:
Hedger Wang
2016-05-22 16:27:53 -07:00
committed by Facebook Github Bot 2
parent 75d538e3eb
commit 1e626027f5
16 changed files with 118 additions and 111 deletions

View File

@@ -43,7 +43,7 @@ const ExampleReducer = NavigationReducer.StackReducer({
initialState: {
key: 'BasicExampleStackKey',
index: 0,
children: [
routes: [
{key: 'First Route'},
],
},
@@ -59,12 +59,12 @@ const NavigationBasicExample = React.createClass({
return (
<ScrollView style={styles.topView}>
<NavigationExampleRow
text={`Current page: ${this.state.children[this.state.index].key}`}
text={`Current page: ${this.state.croutes[this.state.index].key}`}
/>
<NavigationExampleRow
text={`Push page #${this.state.children.length}`}
text={`Push page #${this.state.routes.length}`}
onPress={() => {
this._handleAction({ type: 'push', key: 'page #' + this.state.children.length });
this._handleAction({ type: 'push', key: 'page #' + this.state.routes.length });
}}
/>
<NavigationExampleRow