Skip to content

Commit

Permalink
[base-ui] Fix React spread key warning in test (#42855)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah authored Jul 5, 2024
1 parent 46ba849 commit 3f8e3b4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ describe('useAutocomplete', () => {
{groupedOptions.length > 0 ? (
<ul {...getListboxProps()}>
{groupedOptions.map((option, index) => {
return <li {...getOptionProps({ option, index })}>{option}</li>;
const { key, ...optionProps } = getOptionProps({ option, index });
return (
<li key={key} {...optionProps}>
{option}
</li>
);
})}
</ul>
) : null}
Expand Down

0 comments on commit 3f8e3b4

Please sign in to comment.