File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff 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+
1112import Item from './TabsItem' ;
13+
1214let 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
2121function 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 >
You can’t perform that action at this time.
0 commit comments