Skip to content

Commit

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

Please sign in to comment.