Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Commit

Permalink
fix: pages undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
makotot committed Jan 15, 2021
1 parent 15e9c77 commit 58486de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usePaginated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const usePaginated: UsePaginated = ({
siblingsSize = SIBLING_SIZE,
boundarySize = BOUNDARY_SIZE,
}) => {
const totalPageItems = [...Array(totalPage)].map((_, i) => i + 1);
const totalPageItems = [...Array(totalPage)].fill(1).map((_, i) => i + 1);
const [pages, updatePages] = useState<number[]>([]);
const displayPageItemsSize = siblingsSize * 2 + 1;
const isReachedToFirst = useCallback(() => currentPage <= siblingsSize, [
Expand Down

0 comments on commit 58486de

Please sign in to comment.