Skip to content

Commit

Permalink
[joy-ui][Autocomplete] Fix React spread key warning (#42856)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah authored Jul 5, 2024
1 parent 03dffde commit 7eeca8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/mui-joy/src/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,14 @@ const Autocomplete = React.forwardRef(function Autocomplete(
selectedOptions = renderTags(value as Array<unknown>, getCustomizedTagProps, ownerState);
} else {
selectedOptions = (value as Array<unknown>).map((option, index) => {
const { key: endDecoratorKey, ...endDecoratorProps } = getCustomizedTagProps({ index });
return (
<Chip
key={index}
size={size}
variant="soft"
color="neutral"
endDecorator={<ChipDelete {...getCustomizedTagProps({ index })} />}
endDecorator={<ChipDelete key={endDecoratorKey} {...endDecoratorProps} />}
sx={{ minWidth: 0 }}
>
{getOptionLabel(option)}
Expand Down

0 comments on commit 7eeca8d

Please sign in to comment.