diff --git a/src/components/tab-bar/tab-bar.tsx b/src/components/tab-bar/tab-bar.tsx index 83c9958d0b..0050bb3175 100644 --- a/src/components/tab-bar/tab-bar.tsx +++ b/src/components/tab-bar/tab-bar.tsx @@ -12,7 +12,7 @@ export type TabBarItemProps = { icon?: ReactNode | ((active: boolean) => ReactNode) title?: ReactNode | ((active: boolean) => ReactNode) badge?: BadgeProps['content'] - onClick?: (key: string) => void + onClick?: () => void } & NativeProps /* istanbul ignore next */ @@ -122,7 +122,7 @@ export const TabBar: FC = p => { if (key === undefined || key === null) return setActiveKey(key.toString()) - item.props.onClick?.(key as string) + item.props.onClick?.() }} className={classNames(`${classPrefix}-item`, { [`${classPrefix}-item-active`]: active,