Skip to content

Commit e0bd6a4

Browse files
committed
feat(Tabs): Tabs extends ViewProps. #161
1 parent 88e7bbf commit e0bd6a4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/core/src/Tabs/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ import {
44
SafeAreaView,
55
StatusBar,
66
ScrollView,
7-
ViewStyle,
7+
ViewProps,
88
View,
99
Dimensions
1010
} from 'react-native';
11+
1112
import Item from './TabsItem';
13+
1214
let MainWidth = Dimensions.get('window').width;
1315

14-
export interface TabsProps {
16+
export interface TabsProps extends ViewProps {
1517
/** 子元素 */
16-
children?: JSX.Element | Array<JSX.Element>,
17-
/** 容器样式 */
18-
style?: ViewStyle
18+
children?: JSX.Element | Array<JSX.Element>
1919
}
2020

2121
function Tabs(props: TabsProps) {
22-
const { children } = props
22+
const { style, children, ...other } = props;
2323
if (!children) {
2424
return null;
2525
}
@@ -38,7 +38,7 @@ function Tabs(props: TabsProps) {
3838
horizontal
3939
showsHorizontalScrollIndicator={false}
4040
>
41-
<View style={[styles.TabsContainer, { ...props.style, }]}>
41+
<View style={[styles.TabsContainer, style]} {...other}>
4242
{props.children}
4343
</View>
4444
</ScrollView>

0 commit comments

Comments
 (0)