From f445c017e22fcd37f437db35e478a1558462b408 Mon Sep 17 00:00:00 2001 From: Mike Ellis <39313898+mellis481@users.noreply.github.com> Date: Mon, 13 Dec 2021 15:21:16 -0500 Subject: [PATCH 1/2] Update ExpandedRow.tsx --- src/Body/ExpandedRow.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Body/ExpandedRow.tsx b/src/Body/ExpandedRow.tsx index b3203e8b3..79c07a2bb 100644 --- a/src/Body/ExpandedRow.tsx +++ b/src/Body/ExpandedRow.tsx @@ -25,6 +25,10 @@ function ExpandedRow({ }: ExpandedRowProps) { const { scrollbarSize } = React.useContext(TableContext); const { fixHeader, fixColumn, componentWidth } = React.useContext(ExpandedRowContext); + + if (!expanded) { + return null; + } // Cache render node return React.useMemo(() => { @@ -47,12 +51,7 @@ function ExpandedRow({ } return ( - + {contentNode} From a81457dfd06ba8643736d1b0d2f89c3e0a17eed4 Mon Sep 17 00:00:00 2001 From: Mike Ellis <39313898+mellis481@users.noreply.github.com> Date: Tue, 14 Dec 2021 08:51:46 -0500 Subject: [PATCH 2/2] Fixes lint failure --- src/Body/ExpandedRow.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Body/ExpandedRow.tsx b/src/Body/ExpandedRow.tsx index 79c07a2bb..237035052 100644 --- a/src/Body/ExpandedRow.tsx +++ b/src/Body/ExpandedRow.tsx @@ -25,13 +25,13 @@ function ExpandedRow({ }: ExpandedRowProps) { const { scrollbarSize } = React.useContext(TableContext); const { fixHeader, fixColumn, componentWidth } = React.useContext(ExpandedRowContext); - - if (!expanded) { - return null; - } // Cache render node - return React.useMemo(() => { + return React.useMemo(() => { + if (!expanded) { + return null; + } + let contentNode = children; if (fixColumn) {