Skip to content

Commit 704cb5c

Browse files
aarongarciahweb-flow
authored andcommitted
[joy-ui][Autocomplete] Fix spread key error in test (#42775)
1 parent ff61ec3 commit 704cb5c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/mui-joy/src/Autocomplete/Autocomplete.test.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,14 @@ describe('Joy <Autocomplete />', () => {
480480
renderTags={(value, getTagProps) =>
481481
value
482482
.filter((x, index) => index === 1)
483-
.map((option, index) => (
484-
<Chip key={index} endDecorator={<ChipDelete {...getTagProps({ index })} />}>
485-
{option.title}
486-
</Chip>
487-
))
483+
.map((option, index) => {
484+
const { key, ...tagProps } = getTagProps({ index });
485+
return (
486+
<Chip key={index} endDecorator={<ChipDelete key={key} {...tagProps} />}>
487+
{option.title}
488+
</Chip>
489+
);
490+
})
488491
}
489492
onChange={handleChange}
490493
autoFocus

0 commit comments

Comments
 (0)