Skip to content

Commit

Permalink
refactor: react-table add restoreHierarchyState
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile committed Feb 29, 2024
1 parent edaf5e1 commit 70ebf94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-vtable/src/tables/base-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ const BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {
!isEqual(eventsBinded.current.records, props.records, { skipFunction: skipFunctionDiff })
) {
eventsBinded.current = props;
tableContext.current.table.setRecords(props.records);
tableContext.current.table.setRecords(props.records, {
restoreHierarchyState: props.option.restoreHierarchyState
});
handleTableRender();
}
return;
Expand All @@ -212,7 +214,9 @@ const BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {
handleTableRender();
} else if (hasRecords && !isEqual(props.records, prevRecords.current, { skipFunction: skipFunctionDiff })) {
prevRecords.current = props.records;
tableContext.current.table.setRecords(props.records);
tableContext.current.table.setRecords(props.records, {
restoreHierarchyState: props.option.restoreHierarchyState
});
handleTableRender();
}
// tableContext.current = {
Expand Down

0 comments on commit 70ebf94

Please sign in to comment.