Browse Source

chore: fix buttonGroup ts check error

pointhalo 3 năm trước cách đây
mục cha
commit
da61cc0674
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/semi-ui/button/buttonGroup.tsx

+ 2 - 2
packages/semi-ui/button/buttonGroup.tsx

@@ -15,7 +15,7 @@ export interface ButtonGroupProps extends BaseProps {
     size?: Size;
     theme?: Theme;
     className?: string;
-    children?: React.ReactChild;
+    children?: React.ReactNode;
     'aria-label'?: React.AriaAttributes['aria-label'];
 }
 
@@ -44,7 +44,7 @@ export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
         const cls = classNames(`${prefixCls}-group`, className);
 
         if (children) {
-            inner = ((Array.isArray(children) ? children : [children])).map((itm: React.ReactChild, index) => (
+            inner = ((Array.isArray(children) ? children : [children])).map((itm: React.ReactNode, index) => (
                 isValidElement(itm)
                     ? cloneElement(itm, { disabled, size, type, ...itm.props, ...rest, key: index })
                     : itm