This repository was archived by the owner on Nov 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -530,6 +530,10 @@ Style to apply to the tab bar container.
530530
531531Define a spacing between tabs.
532532
533+ ##### ` testID `
534+
535+ Test id for the tabBar. Can be used for scrolling the tab bar in tests
536+
533537## Using with other libraries
534538
535539### [ React Navigation] ( https://github.com/react-navigation/react-navigation )
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ export type Props<T extends Route> = SceneRendererProps & {
6262 contentContainerStyle ?: StyleProp < ViewStyle > ;
6363 style ?: StyleProp < ViewStyle > ;
6464 gap ?: number ;
65+ testID ?: string ;
6566} ;
6667
6768type FlattenedTabWidth = string | number | undefined ;
@@ -274,6 +275,7 @@ export default function TabBar<T extends Route>({
274275 renderTabBarItem,
275276 style,
276277 tabStyle,
278+ testID,
277279} : Props < T > ) {
278280 const [ layout , setLayout ] = React . useState < Layout > ( { width : 0 , height : 0 } ) ;
279281 const [ tabWidths , setTabWidths ] = React . useState < Record < string , number > > ( { } ) ;
@@ -548,6 +550,7 @@ export default function TabBar<T extends Route>({
548550 renderItem = { renderItem }
549551 onScroll = { handleScroll }
550552 ref = { flatListRef }
553+ testID = { testID }
551554 />
552555 </ View >
553556 </ Animated . View >
You can’t perform that action at this time.
0 commit comments