diff --git a/src/routes/PageResistant.tsx b/src/routes/PageResistant.tsx index 6b28f1d..c6b782b 100644 --- a/src/routes/PageResistant.tsx +++ b/src/routes/PageResistant.tsx @@ -1,4 +1,4 @@ -import { useNavigate, useParams } from "react-router"; +import { redirect, useNavigate, useParams } from "react-router"; import { getResistantPhotoUrl } from "../getResistantPhotoUrl"; import { resistants } from "../resistants"; @@ -8,7 +8,10 @@ export const PageResistant = () => { const resistant = resistants.find((r) => r.id === idResistant); - if (!resistant) return <>RĂ©sistant introuvable; + if (!resistant) { + redirect("/"); + return <>RĂ©sistant introuvable; + } return ( <>