Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const Dropdown = ({ items }: DropdownProps) => {
{items.map((item, index) =>
// href가 있으면 Link로 렌더링
item.href ? (
<Link key={index} href={item.href} className={buttonStyle}>
<Link
key={index}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key=new Date() 로 하는게 좋을것같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new Date() 도 컴포넌트가 생성될때마다 달라지니 고유성이 보장되지 않는거같아요 ㅠ_ㅠ
item.label은 고유할테니 이값으로 key를 설정할게요 !

href={item.href}
onClick={item.onClick}
className={`${buttonStyle} text-center `}
>
{item.label}
</Link>
) : (
Expand Down
1 change: 1 addition & 0 deletions components/HeaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const HeaderMenu = () => {
},
{
label: "로그아웃",
href: "/login",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저의 개인적인 의견으로는 랜딩페이지로 이동 시키는게 낫지않을까 싶습니닷

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옙 알겠습니당

onClick: logout,
},
];
Expand Down
Loading