Skip to content

Commit d6c403c

Browse files
committed
feat: /category 페이지 suspense로 감싸는 로직 추가
1 parent 2651f0d commit d6c403c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/app/category/page.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22
import { useState, useEffect, useRef, useCallback, useLayoutEffect } from 'react';
3+
import { Suspense } from 'react';
34
import { useRouter } from 'next/navigation';
45
import { FullLayout } from '@/components/layout/layouts';
56
import { categoryItems } from '@/data/categories';
@@ -82,7 +83,7 @@ function convertToProduct(item: GroupBuyTop3): Product {
8283
};
8384
}
8485

85-
export default function CategoryPage() {
86+
function CategoryPage() {
8687
const router = useRouter();
8788
const searchParams = useSearchParams();
8889
const sub = searchParams.get('sub');
@@ -344,3 +345,11 @@ export default function CategoryPage() {
344345
</FullLayout>
345346
);
346347
}
348+
349+
export default function CategoryPageWrapper() {
350+
return (
351+
<Suspense fallback={null}>
352+
<CategoryPage />
353+
</Suspense>
354+
);
355+
}

src/services/groupbuyService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
GroupBuyCreateRequest,
77
GroupBuyCreateApiResponse,
88
} from '@/types/groupbuy';
9+
import { Suspense } from 'react';
910

1011
export async function fetchGroupBuyTop3(): Promise<GroupBuyTop3Response> {
1112
const res = await api.get<GroupBuyTop3Response>('/groupbuys/top3');

0 commit comments

Comments
 (0)