Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/mui-material/src/Autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ const Autocomplete = React.forwardRef(function Autocomplete(inProps, ref) {

const renderGroup = renderGroupProp || defaultRenderGroup;
const defaultRenderOption = (props2, option) => {
const { key, ...otherProps } = props2;
// Need to clearly apply key because of https://github.com/vercel/next.js/issues/55642
return (
<li key={key} {...otherProps}>
<li {...props2} key={props2.key}>
Comment on lines +557 to +559
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read the issue but I still can't wrap my head around what the cause is.

And yeah from a performance POV, using the spread operator is always bad, so for leaf elements it can be better to not use it. An easy escape hatch when one is simply transfering props could be to use directly React.createElement('li', props2, children).

{getOptionLabel(option)}
</li>
);
Expand Down