diff --git a/src/components/Pagination/Pagination.mdx b/src/components/Pagination/Pagination.mdx index 7f942e4..c4c8246 100644 --- a/src/components/Pagination/Pagination.mdx +++ b/src/components/Pagination/Pagination.mdx @@ -46,7 +46,7 @@ const onPageChange = (page: number) => { ... }; ### totalPage -전체 페이지 수를 의미하는 프로퍼티입니다. 2 미만의 값을 넣을 경우 에러가 발생합니다.
+전체 페이지 수를 의미하는 프로퍼티입니다. 1 미만의 값을 넣을 경우 에러가 발생합니다.
`totalPage <= 5`일 때, 이전/다음 버튼은 생성되지 않습니다. diff --git a/src/components/Pagination/Pagination.tsx b/src/components/Pagination/Pagination.tsx index c34797c..86893e7 100644 --- a/src/components/Pagination/Pagination.tsx +++ b/src/components/Pagination/Pagination.tsx @@ -6,7 +6,7 @@ import { StyledButton, StyledNav } from './Pagination.style'; import { PaginationProps } from './Pagination.type'; export const Pagination = ({ totalPage, initialPage = 1, onPageChange }: PaginationProps) => { - if (totalPage <= 1) throw new Error('totalPage는 2 이상의 숫자여야 합니다.'); + if (totalPage <= 0) throw new Error('totalPage는 1 이상의 숫자여야 합니다.'); if (initialPage > totalPage) throw new Error('initialPage는 totalPage보다 클 수 없습니다.'); const [currentPage, setCurrentPage] = useState(initialPage);