Skip to content

Commit e86df42

Browse files
committed
최근 게시글 데이터 로딩 조건문을 선행
1 parent 535b6c9 commit e86df42

File tree

1 file changed

+4
-4
lines changed
  • src/components/main/container/PostContainer

1 file changed

+4
-4
lines changed

src/components/main/container/PostContainer/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ const RecentPostSection = ({
2424
size: number;
2525
isLoading: boolean;
2626
}) => {
27-
if (isEmpty(recentPosts)) {
28-
return <div>최근 게시글이 없습니다.</div>;
29-
}
30-
3127
if (isLoading) {
3228
return Array.from({ length: size }, (_, index) => (
3329
<SkeletonPostCard key={index} />
3430
));
3531
}
3632

33+
if (isEmpty(recentPosts)) {
34+
return <div>최근 게시글이 없습니다.</div>;
35+
}
36+
3737
return recentPosts
3838
.slice(0, size)
3939
.map((post) => <RecentPostCard key={post.id} post={post} />);

0 commit comments

Comments
 (0)