diff --git a/src/Body/ExpandedRow.tsx b/src/Body/ExpandedRow.tsx index b3203e8b3..237035052 100644 --- a/src/Body/ExpandedRow.tsx +++ b/src/Body/ExpandedRow.tsx @@ -27,7 +27,11 @@ function ExpandedRow({ const { fixHeader, fixColumn, componentWidth } = React.useContext(ExpandedRowContext); // Cache render node - return React.useMemo(() => { + return React.useMemo(() => { + if (!expanded) { + return null; + } + let contentNode = children; if (fixColumn) { @@ -47,12 +51,7 @@ function ExpandedRow({ } return ( - + {contentNode}