diff --git a/src/DefaultTabBar.tsx b/src/DefaultTabBar.tsx index 540b68e..49ed5cb 100644 --- a/src/DefaultTabBar.tsx +++ b/src/DefaultTabBar.tsx @@ -159,7 +159,7 @@ export class DefaultTabBar extends React.PureComponent { className={cls} onClick={() => this.onPress(i)} > - {renderTab ? renderTab(t) : t.title} + {renderTab ? renderTab(t, i) : t.title} ; } diff --git a/src/PropsType.ts b/src/PropsType.ts index 543cfd6..6bb5fcf 100644 --- a/src/PropsType.ts +++ b/src/PropsType.ts @@ -10,7 +10,7 @@ export interface TabBarPropsType { /** use animate | default: true */ animated: boolean; /** render the tab of tabbar */ - renderTab?: (tab: Models.TabData) => React.ReactNode; + renderTab?: (tab: Models.TabData, index: number) => React.ReactNode; /** render the underline of tabbar */ renderUnderline?: (style: React.CSSProperties | any) => React.ReactNode; /** page size of tabbar's tab | default: 5 */