Skip to content

Commit

Permalink
feat: 도서 목록 조회에 QueryBoundary 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
2scent committed Feb 10, 2025
1 parent 7c94783 commit 96e9ce9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/pages/home/ui/AsyncBookList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';

import { QueryBoundary } from '@/shared/ui/query-boundary';
import { BookList } from '@/entities/book';

export default function AsyncBookList() {
return (
<QueryBoundary>
<BookList />
</QueryBoundary>
);
}
5 changes: 3 additions & 2 deletions src/pages/home/ui/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
import { getQueryClient } from '@/shared/api/query-client';
import { BookList, bookQueries, TabType } from '@/entities/book';
import { bookQueries, TabType } from '@/entities/book';
import { BookSearch } from '@/features/book-search';
import { BookTab } from '@/features/book-tab';
import AsyncBookList from './AsyncBookList';

type SearchParams = Promise<{
q?: string;
Expand All @@ -22,7 +23,7 @@ export default async function HomePage(props: { searchParams: SearchParams }) {
<BookSearch />
{!q && <BookTab />}
</div>
<BookList />
<AsyncBookList />
</div>
</HydrationBoundary>
);
Expand Down

0 comments on commit 96e9ce9

Please sign in to comment.