Kill <NavigationView />

Summary:
= Breaking Change (for experimental features) =

<NavigationView /> serves no obvious benefit and it's costly to maintain it.

- its features could be completely replaced by NavigationAnimatedView without
  enabling the transtion animation.

- it could also be replaced with a simple view and normal scene renderer.

Reviewed By: ericvicenti

Differential Revision: D3280547

fbshipit-source-id: 4ac3dbe92ceb9107a1f6e77a78bd6021485e78a9
This commit is contained in:
Hedger Wang
2016-05-11 16:22:44 -07:00
committed by Facebook Github Bot 1
parent 0934470676
commit c3714d7ed7
3 changed files with 9 additions and 192 deletions

View File

@@ -38,7 +38,6 @@ const {
CardStack: NavigationCardStack,
Header: NavigationHeader,
Reducer: NavigationReducer,
View: NavigationView,
} = NavigationExperimental;
@@ -267,7 +266,7 @@ class NavigationCompositionExample extends React.Component {
}
class ExampleMainView extends React.Component {
_renderScene: NavigationSceneRenderer;
_renderScene: Function;
_handleNavigation: Function;
componentWillMount() {
@@ -277,21 +276,19 @@ class ExampleMainView extends React.Component {
render() {
return (
<NavigationView
navigationState={this.props.navigationState}
onNavigate={this._handleNavigation}
style={styles.tabsContent}
renderScene={this._renderScene}
/>
<View style={styles.tabsContent}>
{this._renderScene()}
</View>
);
}
_renderScene(props: NavigationSceneRendererProps): ReactElement {
const {scene} = props;
_renderScene(): ReactElement {
const {navigationState} = this.props;
const childState = navigationState.children[navigationState.index];
return (
<ExampleTabScreen
key={'tab_screen' + scene.key}
navigationState={scene.navigationState}
key={'tab_screen' + childState.key}
navigationState={childState}
onNavigate={this._handleNavigation}
/>
);