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 5b2b4e9 commit 38a8a5eCopy full SHA for 38a8a5e
src/hooks/useColumns.tsx
@@ -165,18 +165,11 @@ function useColumns<RecordType>(
165
record,
166
onExpand: onTriggerExpand,
167
});
168
- return React.isValidElement(icon)
169
- ? React.cloneElement(icon, {
170
- onClick: (e: MouseEvent) => {
171
- if (expandRowByClick) {
172
- e.stopPropagation();
173
- }
174
- if (icon && icon.props && icon.props.onClick) {
175
- icon.props.onClick(e);
176
177
- },
178
- })
179
- : icon;
+
+ if (expandRowByClick) {
+ return <span onClick={e => e.stopPropagation()}>{icon}</span>;
+ }
+ return icon;
180
},
181
};
182
0 commit comments