Skip to content

Commit

Permalink
[base-ui] Fix React spread key warning in test (#42744)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jul 5, 2024
1 parent e5e9b9d commit f574bbd
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 f574bbd

Please sign in to comment.