Skip to content

Commit

Permalink
Fix lists without key prop errors (#508)
Browse files Browse the repository at this point in the history
This PR adds keys to lists in DeviceSettingsDropdown and
IconButtonWithOptions to prevent error messages.
  • Loading branch information
p-malecki authored Aug 21, 2024
1 parent 064f0cb commit a40eb80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ function DeviceSettingsDropdown({ children, disabled }: DeviceSettingsDropdownPr
className="dropdown-menu-content"
sideOffset={2}
alignOffset={-5}>
{resetOptions.map((option) => (
{resetOptions.map((option, index) => (
<DropdownMenu.Item
className="dropdown-menu-item"
key={index}
onSelect={() => project.resetAppPermissions(option.value)}>
<span className={`codicon codicon-${option.icon}`} />
{option.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const IconButtonWithOptions = forwardRef<HTMLButtonElement, IconButtonWit
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content className="dropdown-menu-content">
{Object.entries(options).map(([title, onSelect]) => (
<DropdownMenu.Item className="dropdown-menu-item" onSelect={onSelect}>
{Object.entries(options).map(([title, onSelect], index) => (
<DropdownMenu.Item className="dropdown-menu-item" key={index} onSelect={onSelect}>
{title}
</DropdownMenu.Item>
))}
Expand Down

0 comments on commit a40eb80

Please sign in to comment.