Skip to content

Commit f574bbd

Browse files
committed
[base-ui] Fix React spread key warning in test (#42744)
1 parent e5e9b9d commit f574bbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/mui-base/src/useAutocomplete/useAutocomplete.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ describe('useAutocomplete', () => {
263263
{groupedOptions.length > 0 ? (
264264
<ul {...getListboxProps()}>
265265
{groupedOptions.map((option, index) => {
266-
return <li {...getOptionProps({ option, index })}>{option}</li>;
266+
const { key, ...optionProps } = getOptionProps({ option, index });
267+
return (
268+
<li key={key} {...optionProps}>
269+
{option}
270+
</li>
271+
);
267272
})}
268273
</ul>
269274
) : null}

0 commit comments

Comments
 (0)