Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: [DEV] Console Warning when opening FAB menu #43984

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ function PopoverMenu({
{enteredSubMenuIndexes.length > 0 && renderBackButtonItem()}
{currentMenuItems.map((item, menuIndex) => (
<FocusableMenuItem
key={item.text}
// eslint-disable-next-line react/no-array-index-key
key={`${item.text}_${menuIndex}`}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ishpaul777 , do you think we should disable the rule here? We do the same at one other place:

// eslint-disable-next-line react/no-array-index-key
key={`${text}${i}`}

If no then we can try using item.label instead, what do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think disabling rule should be enough 👍

icon={item.icon}
iconWidth={item.iconWidth}
iconHeight={item.iconHeight}
Expand Down
Loading