From 2762f403941c9bdd151b36ad576ce6c942a54c1b Mon Sep 17 00:00:00 2001 From: ztplz Date: Tue, 16 Jul 2019 17:32:55 +0800 Subject: [PATCH] Correct renderTabBar type --- components/tabs/index.en-US.md | 2 +- components/tabs/index.tsx | 5 ++++- components/tabs/index.zh-CN.md | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index 8a57bfee71..46140d8981 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -23,7 +23,7 @@ Ant Design has 3 types of Tabs for different situations. | --- | --- | --- | --- | --- | | activeKey | Current TabPane's key | string | - | | | animated | Whether to change tabs with animation. Only works while `tabPosition="top"\|"bottom"` | boolean \| {inkBar:boolean, tabPane:boolean} | `true`, `false` when `type="card"` | | -| renderTabBar | replace the TabBar | (props: DefaultTabBarProps, DefaultTabBar: React.ReactNode) => React.ReactNode | - | 3.9.0 | +| renderTabBar | replace the TabBar | (props: DefaultTabBarProps, DefaultTabBar: React.ComponentClass) => React.ReactElement | - | 3.9.0 | | defaultActiveKey | Initial active TabPane's key, if `activeKey` is not set. | string | - | | | hideAdd | Hide plus icon or not. Only works while `type="editable-card"` | boolean | `false` | | | size | preset tab bar size | `large` \| `default` \| `small` | `default` | | diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 80972dad39..13af137a83 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -31,7 +31,10 @@ export interface TabsProps { className?: string; animated?: boolean | { inkBar: boolean; tabPane: boolean }; tabBarGutter?: number; - renderTabBar?: (props: TabsProps, DefaultTabBar: React.ReactNode) => React.ReactElement; + renderTabBar?: ( + props: TabsProps, + DefaultTabBar: React.ComponentClass, + ) => React.ReactElement; destroyInactiveTabPane?: boolean; } diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index bf9af32157..23e85e4bef 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -26,7 +26,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | --- | --- | --- | --- | --- | | activeKey | 当前激活 tab 面板的 key | string | 无 | | | animated | 是否使用动画切换 Tabs,在 `tabPosition=top|bottom` 时有效 | boolean \| {inkBar:boolean, tabPane:boolean} | true, 当 type="card" 时为 false | | -| renderTabBar | 替换 TabBar,用于二次封装标签头 | (props: DefaultTabBarProps, DefaultTabBar: React.ReactNode) => React.ReactNode | 无 | 3.9.0 | +| renderTabBar | 替换 TabBar,用于二次封装标签头 | (props: DefaultTabBarProps, DefaultTabBar: React.ComponentClass) => React.ReactElement | 无 | 3.9.0 | | defaultActiveKey | 初始化选中面板的 key,如果没有设置 activeKey | string | 第一个面板 | | | hideAdd | 是否隐藏加号图标,在 `type="editable-card"` 时有效 | boolean | false | | | size | 大小,提供 `large` `default` 和 `small` 三种大小 | string | 'default' | |