Browse Source

give the tr element a unique key

Shun Miyazawa 2 years ago
parent
commit
5453c2d925

+ 2 - 2
apps/app/src/features/search/client/components/SearchResults.tsx

@@ -19,8 +19,8 @@ export const SearchResults = (props: Props): JSX.Element => {
     <>
     <>
       <table>
       <table>
         <tbody>
         <tbody>
-          {searchResult.data?.map((pageWithMeta, index) => (
-            <tr>
+          {searchResult.data?.map(pageWithMeta => (
+            <tr key={pageWithMeta.data._id}>
               <div className="ps-1 mb-2">
               <div className="ps-1 mb-2">
                 <UserPicture />
                 <UserPicture />
                 <span className="ms-3 text-break text-wrap"><PagePathLabel path={pageWithMeta.data.path} /></span>
                 <span className="ms-3 text-break text-wrap"><PagePathLabel path={pageWithMeta.data.path} /></span>