Skip to content

Commit

Permalink
feature-065: unique key 부여
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0428 committed Feb 14, 2024
1 parent fabc6eb commit 805d83d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/category/DefaultMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const DefaultMenu = ({
<>
<div style={{ display: 'flex' }}>
{menus.map((menu: ISubFolderProps | ITagProps) => (
<>
<div key={menu.name}>
{'tag_id' in menu && (
<Chip
key={menu.tag_id}
Expand All @@ -48,7 +48,7 @@ const DefaultMenu = ({
{menu.name}
</CategoryPageStyles.Menu>
)}
</>
</div>
))}
</div>
<CategoryPageStyles.ModeWrap onClick={toggleRecentRegisterMode}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const CategoryPage = () => {
video={video}
checkedVideos={checkedVideos}
setCheckedVideos={setCheckedVideos}
key={video.category_id}
key={video.video_id}
/>
);
})}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/handleVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const handleVideo = async (
setName: React.Dispatch<React.SetStateAction<string>>,
setVideos: React.Dispatch<React.SetStateAction<IVideoProps[]>>,
) => {
await getVideoById(topCategoryId).then((res) => {
await getVideoById(topCategoryId).then(async (res) => {
const topCategory = categories.find(
(category) => category.categoryId === Number(topCategoryId),
);
Expand All @@ -22,7 +22,7 @@ const handleVideo = async (
(subFolder) => subFolder.categoryId === Number(subCategoryId),
);
setName(subName!.name);
getCategoryTags(subCategoryId!).then((res) => {
await getCategoryTags(subCategoryId!).then((res) => {
if (res.isSuccess) setMenus(res.result.tags);
else setMenus([]);
});
Expand Down

0 comments on commit 805d83d

Please sign in to comment.