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