File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/core/src/components/TabView Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ type KeyboardDismissMode = "none" | "auto" | "on-drag";
2626type TabViewProps = {
2727 onIndexChanged ?: ( index : number ) => void ;
2828 onEndReached ?: ( ) => void ;
29+ initialTabIndex ?: number ;
2930 tabBarPosition ?: TabBarPosition ;
3031 keyboardDismissMode ?: KeyboardDismissMode ;
3132 swipeEnabled ?: boolean ;
@@ -43,6 +44,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
4344 Icon,
4445 onIndexChanged,
4546 onEndReached,
47+ initialTabIndex = 0 ,
4648 tabBarPosition,
4749 keyboardDismissMode,
4850 swipeEnabled,
@@ -56,7 +58,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
5658 theme,
5759 children : childrenProp ,
5860} ) => {
59- const [ index , setIndex ] = React . useState ( 0 ) ;
61+ const [ index , setIndex ] = React . useState ( initialTabIndex ) ;
6062 const [ routes , setRoutes ] = React . useState < Route [ ] > ( [ ] ) ;
6163 const [ tabScenes , setTabScenes ] = React . useState < { [ key : string ] : any } > ( { } ) ;
6264
You can’t perform that action at this time.
0 commit comments