Skip to content

Commit ac2582a

Browse files
committed
Do not spread key prop
1 parent 5fdc832 commit ac2582a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,14 @@ const Autocomplete = React.forwardRef(function Autocomplete(
632632
},
633633
});
634634

635-
const defaultRenderOption = (optionProps: any, option: unknown) => (
636-
<SlotOption {...optionProps}>{getOptionLabel(option)}</SlotOption>
637-
);
635+
const defaultRenderOption = (optionProps: any, option: unknown) => {
636+
const { key, ...rest } = optionProps;
637+
return (
638+
<SlotOption key={key} {...rest}>
639+
{getOptionLabel(option)}
640+
</SlotOption>
641+
);
642+
};
638643

639644
const renderOption = renderOptionProp || defaultRenderOption;
640645

0 commit comments

Comments
 (0)