Skip to content

Commit d93d938

Browse files
committed
Fix React spread key warning in test
1 parent 280c2fa commit d93d938

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
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)