Skip to content

Commit b102fd1

Browse files
committed
fix: useRequest pagiantion mode current & pageSize calculation error
1 parent 6219cbb commit b102fd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/use-request/src/usePaginated.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ function usePaginated<R, Item, U extends Item = any>(
7272

7373
const tempTotalPage = Math.ceil(total / toPageSize);
7474
if (toCurrent > tempTotalPage) {
75-
toCurrent = tempTotalPage;
75+
toCurrent = Math.max(1, tempTotalPage);
7676
}
7777
runChangePagination({
78-
current: c,
79-
pageSize: p,
78+
current: toCurrent,
79+
pageSize: toPageSize,
8080
});
8181
},
8282
[total, runChangePagination],

0 commit comments

Comments
 (0)