diff --git a/src/Card/index.js b/src/Card/index.js index 9b6505449a..fcd94285de 100644 --- a/src/Card/index.js +++ b/src/Card/index.js @@ -130,9 +130,18 @@ class Card extends React.Component { // Jest test return []; } - return children[0].type.name === Loading.name && !children[0].props.loading - ? children[0].props.children - : children; + + if (children[0].type.name === Loading.name && !children[0].props.loading) { + if ( + !Array.isArray(children[0].props.children) && + children[0].props.children.type.toString() === React.Fragment.toString() + ) { + return children[0].props.children.props.children; + } + + return children[0].props.children; + } + return children; }; isExpandableCardSection = (item: any) => @@ -151,7 +160,6 @@ class Card extends React.Component { hasAdjustedHeader = () => { const children = this.getChildren(); - // Check if first element is Header if (children[0] !== undefined && children[0].type.name !== CardHeader.name) { return false;