Checkpoint: Correction de l'avertissement React "Each child in a list should have a unique key prop" dans Home.tsx — remplacement du fragment <> sans key par <Fragment key={etab.id}> dans le .map() des résultats de recherche.

This commit is contained in:
Manus
2026-04-16 05:46:38 -04:00
parent a58296774f
commit 249aa80e38

View File

@@ -16,7 +16,7 @@ import {
SlidersHorizontal,
X,
} from "lucide-react";
import { useState, useMemo } from "react";
import { useState, useMemo, Fragment } from "react";
import { useLocation } from "wouter";
import { REGIONS, TYPES_ACTIVITE, TAILLES_EFFECTIFS } from "../../../shared/referentiel";
import ContactModal from "@/components/ContactModal";
@@ -302,9 +302,8 @@ export default function Home() {
</thead>
<tbody className="divide-y divide-border">
{sortedResults.map((etab) => (
<>
<Fragment key={etab.id}>
<tr
key={etab.id}
className="hover:bg-muted/30 transition-colors cursor-pointer"
onClick={() => handleViewEtab(etab.id)}
>
@@ -352,13 +351,13 @@ export default function Home() {
</td>
</tr>
{expandedEtab === etab.id && (
<tr key={`${etab.id}-expanded`} className="bg-muted/20">
<tr className="bg-muted/20">
<td colSpan={5} className="px-5 py-4">
<LogicielsInline etablissementId={etab.id} />
</td>
</tr>
)}
</>
</Fragment>
))}
</tbody>
</table>