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:28:27 -07:00
committed by Facebook Github Bot 2
parent 75d538e3eb
commit 1e626027f5
16 changed files with 118 additions and 111 deletions
@@ -106,7 +106,7 @@ const ExampleAppReducer = NavigationReducer.TabsReducer({
initialState: {
key: 'notifs',
index: 0,
children: [
routes: [
{key: 'base', type: 'NotifsPage'},
],
},
@@ -121,7 +121,7 @@ const ExampleAppReducer = NavigationReducer.TabsReducer({
initialState: {
key: 'settings',
index: 0,
children: [
routes: [
{key: 'base', type: 'SettingsPage'},
],
},
@@ -136,7 +136,7 @@ const ExampleAppReducer = NavigationReducer.TabsReducer({
initialState: {
key: 'profile',
index: 0,
children: [
routes: [
{key: 'base', type: 'ProfilePage'},
],
},
@@ -256,7 +256,7 @@ class NavigationCompositionExample extends React.Component {
onNavigate={this.handleAction.bind(this)}
/>
<NavigationExampleTabBar
tabs={this.state.children}
tabs={this.state.routes}
index={this.state.index}
onNavigate={this.handleAction.bind(this)}
/>
@@ -284,7 +284,7 @@ class ExampleMainView extends React.Component {
_renderScene(): ReactElement {
const {navigationState} = this.props;
const childState = navigationState.children[navigationState.index];
const childState = navigationState.routes[navigationState.index];
return (
<ExampleTabScreen
key={'tab_screen' + childState.key}