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