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(