Skip to content

Commit

Permalink
Fix React spread key warning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jun 24, 2024
1 parent 280c2fa commit d93d938
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 d93d938

Please sign in to comment.