mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 04:13:51 +08:00
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:
committed by
Facebook Github Bot 1
parent
0934470676
commit
c3714d7ed7
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user