We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a15383c commit 5e3ecd0Copy full SHA for 5e3ecd0
src/TransBtn.tsx
@@ -1,9 +1,10 @@
1
import * as React from 'react';
2
import classNames from 'classnames';
3
+import { RenderNode } from './interface';
4
5
export interface TransBtnProps {
6
className: string;
- customizeIcon: React.ReactNode;
7
+ customizeIcon: RenderNode;
8
customizeIconProps?: { isSelected: boolean };
9
onMouseDown?: React.MouseEventHandler<HTMLSpanElement>;
10
onClick?: React.MouseEventHandler<HTMLSpanElement>;
@@ -43,7 +44,9 @@ const TransBtn: React.FC<TransBtnProps> = ({
43
44
onClick={onClick}
45
aria-hidden
46
>
- {icon || (
47
+ {icon !== undefined ? (
48
+ icon
49
+ ) : (
50
<span className={classNames(className.split(/\s+/).map(cls => `${cls}-icon`))}>
51
{children}
52
</span>
0 commit comments