Skip to content

Commit

Permalink
fix: add key prop for each subMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
wewoor committed Nov 23, 2020
1 parent 47dadcd commit f36f09e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function Menu(props: React.PropsWithChildren<IMenu>) {
return menus.map((item: IMenu) => {
if (item.data && item.data.length > 0) {
return (
<SubMenu mode={mode} {...item}>
<SubMenu key={item.id} mode={mode} {...item}>
{renderMenusByData(item.data)}
</SubMenu>
);
Expand Down
3 changes: 1 addition & 2 deletions src/components/menu/subMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ export function SubMenu(props: React.PropsWithChildren<ISubMenu>) {
/>
) : (
<Menu className={cNames} style={{ visibility: 'hidden' }}>
{' '}
{children}{' '}
{children}
</Menu>
);

Expand Down

0 comments on commit f36f09e

Please sign in to comment.