File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ export interface ITab {
17
17
mode ?: string ;
18
18
data ?: [ ] ;
19
19
value ?: string ;
20
- renderPane ?: string | React . ReactNode ;
20
+ renderPane ?: ( ) => React . ReactNode ;
21
21
}
22
22
interface ITabsProps {
23
23
data : ITab [ ] ;
24
24
closeTab ?: ( index : number ) => void ;
25
25
changeTab ?: ( tabs : ITab [ ] ) => void ;
26
- selectTab : ( index : number ) => void ;
27
- children : React . ReactNode | JSX . Element ;
26
+ selectTab ? : ( index : number ) => void ;
27
+ children ? : React . ReactNode ;
28
28
}
29
29
30
30
const DraggleTabs : React . FC < ITabsProps > = ( props : ITabsProps ) => {
@@ -47,7 +47,7 @@ const DraggleTabs: React.FC<ITabsProps> = (props: ITabsProps) => {
47
47
48
48
const onTabClick = ( key ) => {
49
49
console . log ( `onTabClick ${ key } ` ) ;
50
- selectTab ( key ) ;
50
+ if ( selectTab ) selectTab ( key ) ;
51
51
} ;
52
52
53
53
const renderTabBar = ( props , DefaultTabBar ) => {
You can’t perform that action at this time.
0 commit comments