Hide overflow on individual pages in tab view (#1271)

This commit is contained in:
Satyajit Sahoo 2017-04-28 18:53:25 +05:30 committed by Mike Grabowski
parent b532f8cc19
commit b8dbbe964e

View File

@ -1,7 +1,7 @@
/* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet } from 'react-native';
import { View, StyleSheet } from 'react-native';
import { TabViewAnimated, TabViewPagerPan } from 'react-native-tab-view';
import SceneView from '../SceneView';
import withCachedChildNavigation from '../../withCachedChildNavigation';
@ -62,11 +62,13 @@ class TabView extends PureComponent<void, Props, void> {
route.routeName,
);
return (
<SceneView
screenProps={screenProps}
component={TabComponent}
navigation={childNavigation}
/>
<View style={styles.page}>
<SceneView
screenProps={screenProps}
component={TabComponent}
navigation={childNavigation}
/>
</View>
);
};
@ -180,12 +182,15 @@ class TabView extends PureComponent<void, Props, void> {
}
}
const TabViewEnhanced = withCachedChildNavigation(TabView);
export default TabViewEnhanced;
export default withCachedChildNavigation(TabView);
const styles = StyleSheet.create({
container: {
flex: 1,
},
page: {
flex: 1,
overflow: 'hidden',
},
});