Skip to content

Commit 8891b52

Browse files
committed
fix: typing error
1 parent 8691459 commit 8891b52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/tabs/index.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export interface ITab {
1717
mode?: string;
1818
data?: [];
1919
value?: string;
20-
renderPane?: string | React.ReactNode;
20+
renderPane?: () => React.ReactNode;
2121
}
2222
interface ITabsProps {
2323
data: ITab[];
2424
closeTab?: (index: number) => void;
2525
changeTab?: (tabs: ITab[]) => void;
26-
selectTab: (index: number) => void;
27-
children: React.ReactNode | JSX.Element;
26+
selectTab?: (index: number) => void;
27+
children?: React.ReactNode;
2828
}
2929

3030
const DraggleTabs: React.FC<ITabsProps> = (props: ITabsProps) => {
@@ -47,7 +47,7 @@ const DraggleTabs: React.FC<ITabsProps> = (props: ITabsProps) => {
4747

4848
const onTabClick = (key) => {
4949
console.log(`onTabClick ${key}`);
50-
selectTab(key);
50+
if (selectTab) selectTab(key);
5151
};
5252

5353
const renderTabBar = (props, DefaultTabBar) => {

0 commit comments

Comments
 (0)