Skip to content

Commit

Permalink
fix(table): fix usePagination the isPagination issue
Browse files Browse the repository at this point in the history
fix #2957
  • Loading branch information
HaixingOoO committed Jun 21, 2024
1 parent 5118760 commit 442b953
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/table/hooks/usePagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export default function usePagination(props: TdBaseTableProps) {
[data, disableDataPage],
);

useEffect(() => {
if (!pagination) {
setIsPaginateData(false);
setDataSource([]);
}
}, [pagination]);

// 受控情况,只有 pagination.current 或者 pagination.pageSize 变化,才对数据进行排序
useEffect(() => {
if (!pagination || !pagination.current) return;
Expand Down

0 comments on commit 442b953

Please sign in to comment.