Skip to content

Commit

Permalink
fix(categories): 카테고리 데이터가 배열인지 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
joojjang committed Aug 3, 2024
1 parent 52a07cc commit f28ddf9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/features/Home/CategorySection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ export const CategorySection = () => {
md: 6,
}}
>
{data.map((category) => (
<Link
key={category.categoryId}
to={getDynamicPath.category(category.categoryId.toString())}
>
<CategoryItem image={category.imageUrl} label={category.name} />
</Link>
))}
{Array.isArray(data)
? data.map((category) => (
<Link
key={category.categoryId}
to={getDynamicPath.category(category.categoryId.toString())}
>
<CategoryItem image={category.imageUrl} label={category.name} />
</Link>
))
: null}
</Grid>
</Container>
</Wrapper>
Expand Down

0 comments on commit f28ddf9

Please sign in to comment.