File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ import * as React from 'react';
1111import { useIndicator , useOffsetScroller } from './internal' ;
1212import TabsHeaderItem from './TabsHeaderItem' ;
1313import { TabsContext } from './context' ;
14+ import type { ReactElement } from 'react' ;
15+ import type { TabScreenProps } from './TabScreen' ;
1416
1517export default function TabsHeader ( {
16- children,
1718 position,
1819 offset,
1920 theme,
@@ -24,7 +25,9 @@ export default function TabsHeader({
2425 showLeadingSpace,
2526 uppercase,
2627 mode,
28+ ...rest
2729} : SwiperRenderProps ) {
30+ const children = React . Children . toArray ( rest . children ) . filter ( Boolean ) ;
2831 const { index, goTo } = React . useContext ( TabsContext ) ;
2932 const { colors, dark : isDarkTheme , mode : themeMode , isV3 } = theme ;
3033 const {
@@ -194,11 +197,11 @@ export default function TabsHeader({
194197 < View style = { styles . scrollablePadding } />
195198 ) : null }
196199
197- { React . Children . map ( children . filter ( Boolean ) , ( tab , tabIndex ) => (
200+ { React . Children . map ( children , ( tab , tabIndex ) => (
198201 < TabsHeaderItem
199202 theme = { theme }
200203 tabIndex = { tabIndex }
201- tab = { tab }
204+ tab = { tab as ReactElement < TabScreenProps > }
202205 active = { index === tabIndex }
203206 onTabLayout = { onTabLayout }
204207 goTo = { goTo }
You can’t perform that action at this time.
0 commit comments