Skip to content

Commit

Permalink
fix(search): pass key as prop (#12009)
Browse files Browse the repository at this point in the history
Before we get:
Warning: A props object containing a "key" prop is being spread into JSX
  • Loading branch information
fiji-flo authored Oct 23, 2024
1 parent 3ec66c2 commit 08ec90c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ function InnerSearchNavigateWidget(props: InnerSearchNavigateWidgetProps) {
[
...resultItems.map((item, i) => (
<div
key={item.url}
{...getItemProps({
key: item.url,
className: `result-item ${
i === highlightedIndex ? "highlight " : ""
}`,
Expand All @@ -394,11 +394,11 @@ function InnerSearchNavigateWidget(props: InnerSearchNavigateWidgetProps) {
</div>
)),
<div
key="nothing-found"
{...getItemProps({
className:
"nothing-found result-item " +
(highlightedIndex === resultItems.length ? "highlight" : ""),
key: "nothing-found",
item: onlineSearch,
index: resultItems.length,
})}
Expand Down

0 comments on commit 08ec90c

Please sign in to comment.