diff --git a/frontend/src/components/Recipe/CommentList/CommentList.tsx b/frontend/src/components/Recipe/CommentList/CommentList.tsx index 0330c705..d44f33c3 100644 --- a/frontend/src/components/Recipe/CommentList/CommentList.tsx +++ b/frontend/src/components/Recipe/CommentList/CommentList.tsx @@ -16,7 +16,8 @@ const CommentList = ({ recipeId }: CommentListProps) => { const { fetchNextPage, hasNextPage, data } = useInfiniteRecipeCommentQuery(Number(recipeId)); useIntersectionObserver(fetchNextPage, scrollRef, hasNextPage); - const [{ totalElements, comments }] = data.pages.flatMap((page) => page); + const [{ totalElements }] = data.pages.flatMap((page) => page); + const comments = data.pages.flatMap((page) => page.comments); return ( <>