Skip to content

Commit

Permalink
[joy-ui][Autocomplete] Fix React spread key warning (#42741)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jul 5, 2024
1 parent e5e9b9d commit e2877b0
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 e2877b0

Please sign in to comment.