Skip to content

Commit b8dbbe9

Browse files
satya164grabbou
authored andcommitted
Hide overflow on individual pages in tab view (react-navigation#1271)
1 parent b532f8c commit b8dbbe9

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/views/TabView/TabView.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22

33
import React, { PureComponent } from 'react';
4-
import { StyleSheet } from 'react-native';
4+
import { View, StyleSheet } from 'react-native';
55
import { TabViewAnimated, TabViewPagerPan } from 'react-native-tab-view';
66
import SceneView from '../SceneView';
77
import withCachedChildNavigation from '../../withCachedChildNavigation';
@@ -62,11 +62,13 @@ class TabView extends PureComponent<void, Props, void> {
6262
route.routeName,
6363
);
6464
return (
65-
<SceneView
66-
screenProps={screenProps}
67-
component={TabComponent}
68-
navigation={childNavigation}
69-
/>
65+
<View style={styles.page}>
66+
<SceneView
67+
screenProps={screenProps}
68+
component={TabComponent}
69+
navigation={childNavigation}
70+
/>
71+
</View>
7072
);
7173
};
7274

@@ -180,12 +182,15 @@ class TabView extends PureComponent<void, Props, void> {
180182
}
181183
}
182184

183-
const TabViewEnhanced = withCachedChildNavigation(TabView);
184-
185-
export default TabViewEnhanced;
185+
export default withCachedChildNavigation(TabView);
186186

187187
const styles = StyleSheet.create({
188188
container: {
189189
flex: 1,
190190
},
191+
192+
page: {
193+
flex: 1,
194+
overflow: 'hidden',
195+
},
191196
});

0 commit comments

Comments
 (0)