diff --git a/src/routes/PageResistant.tsx b/src/routes/PageResistant.tsx index 5ae1fc4..c0ffdc2 100644 --- a/src/routes/PageResistant.tsx +++ b/src/routes/PageResistant.tsx @@ -1,17 +1,18 @@ -import {useLoaderData, useParams} from "react-router"; +import {useLoaderData, useNavigate, useParams} from "react-router"; import {Link} from "react-router-dom"; import {Resistant} from "../Resistant"; export const PageResistant = () => { const {nomResistant} = useParams() const {resistants} = useLoaderData() as { resistants: Resistant[] } + const navigate = useNavigate() const resistant = resistants.find(r => r.noms === nomResistant) if (!resistant) return <>Résistant introuvable> return <> - Retour à la liste des résistants +