Skip to content

Commit

Permalink
fix: fix eventsBinded update in react-vtable
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Apr 11, 2024
1 parent e644027 commit 129cb2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-vtable/src/tables/base-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ const BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {

if (hasOption) {
if (!isEqual(eventsBinded.current.option, props.option, { skipFunction: skipFunctionDiff })) {
eventsBinded.current = props;
// eslint-disable-next-line promise/catch-or-return
tableContext.current.table.updateOption(parseOption(props));
handleTableRender();
eventsBinded.current = props;
} else if (
hasRecords &&
!isEqual(eventsBinded.current.records, props.records, { skipFunction: skipFunctionDiff })
) {
eventsBinded.current = props;
tableContext.current.table.setRecords(props.records as any[]);
handleTableRender();
eventsBinded.current = props;
}
return;
}
Expand All @@ -221,10 +221,12 @@ const BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {
// eslint-disable-next-line promise/catch-or-return
tableContext.current.table.updateOption(parseOption(props));
handleTableRender();
eventsBinded.current = props;
} else if (hasRecords && !isEqual(props.records, prevRecords.current, { skipFunction: skipFunctionDiff })) {
prevRecords.current = props.records;
tableContext.current.table.setRecords(props.records);
handleTableRender();
eventsBinded.current = props;
}
// tableContext.current = {
// ...tableContext.current,
Expand Down

0 comments on commit 129cb2b

Please sign in to comment.