rusackas commented on a change in pull request #13037:
URL: https://github.com/apache/superset/pull/13037#discussion_r573347583
##########
File path: superset-frontend/src/components/Button/index.tsx
##########
@@ -144,6 +144,17 @@ export default function Button(props: ButtonProps) {
colorHover = primary.base;
}
+ const element = children as ReactElement;
+
+ let renderedChildren = [];
+ if (element && element.type === React.Fragment) {
+ renderedChildren = Children.toArray(element.props.children);
+ } else {
+ renderedChildren = Children.toArray(children);
+ }
+
Review comment:
```suggestion
const renderedChildren = Children.toArray(element?.type == React.Fragment ?
element.props.children : children);
```
Not sure if it's easier to read in a one liner and/or with a null-coalescing
operator. ¯\\\_(ツ)_/¯
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]