diff --git a/src/TransBtn.tsx b/src/TransBtn.tsx index 04138bee7..7421b3770 100644 --- a/src/TransBtn.tsx +++ b/src/TransBtn.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import classNames from 'classnames'; +import { RenderNode } from './interface'; export interface TransBtnProps { className: string; - customizeIcon: React.ReactNode; + customizeIcon: RenderNode; customizeIconProps?: { isSelected: boolean }; onMouseDown?: React.MouseEventHandler; onClick?: React.MouseEventHandler; @@ -43,7 +44,9 @@ const TransBtn: React.FC = ({ onClick={onClick} aria-hidden > - {icon || ( + {icon !== undefined ? ( + icon + ) : ( `${cls}-icon`))}> {children}