Skip to content

Commit

Permalink
fix(Table): fix expandedTreeNodes change effect
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Nov 14, 2024
1 parent 683e359 commit 44adef5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/table/hooks/useTreeData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface UseSwapParams<T> extends SwapParams<T> {
}

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<typeof TableTreeStore>);
const [treeNodeCol, setTreeNodeCol] = useState<PrimaryTableCol>(() => getTreeNodeColumnCol());
const [dataSource, setDataSource] = useState<TdEnhancedTableProps['data']>(data || []);
Expand Down Expand Up @@ -70,7 +70,7 @@ export default function useTreeData(props: TdEnhancedTableProps) {
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[data],
[data, expandedTreeNodes],
);

useEffect(
Expand Down

0 comments on commit 44adef5

Please sign in to comment.