Skip to content

Commit

Permalink
fix(search): pass key as prop
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 committed Oct 22, 2024
1 parent 50518f3 commit 5385dcc
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 @@ -372,8 +372,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 @@ -392,11 +392,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 5385dcc

Please sign in to comment.