From 44adef59fc9c77e1c5f956e42a2023f439054846 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Thu, 14 Nov 2024 15:32:30 +0800 Subject: [PATCH] fix(Table): fix expandedTreeNodes change effect --- src/table/hooks/useTreeData.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/table/hooks/useTreeData.tsx b/src/table/hooks/useTreeData.tsx index 4fabd6b0a6..3015bd8c53 100644 --- a/src/table/hooks/useTreeData.tsx +++ b/src/table/hooks/useTreeData.tsx @@ -19,7 +19,7 @@ export interface UseSwapParams extends SwapParams { } export default function useTreeData(props: TdEnhancedTableProps) { - const { data, columns, tree, rowKey, treeExpandAndFoldIcon } = props; + const { data, columns, tree, rowKey, treeExpandAndFoldIcon, expandedTreeNodes } = props; const [store] = useState(new TableTreeStore() as InstanceType); const [treeNodeCol, setTreeNodeCol] = useState(() => getTreeNodeColumnCol()); const [dataSource, setDataSource] = useState(data || []); @@ -70,7 +70,7 @@ export default function useTreeData(props: TdEnhancedTableProps) { } }, // eslint-disable-next-line react-hooks/exhaustive-deps - [data], + [data, expandedTreeNodes], ); useEffect(