From b5906c3f9294950ec633234ff3dd7a4599d21b89 Mon Sep 17 00:00:00 2001 From: Melissa Date: Wed, 24 Jun 2026 11:41:52 +0200 Subject: [PATCH] trying to understand how to add a like total that works --- react-project/src/App.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/react-project/src/App.jsx b/react-project/src/App.jsx index 1a5e347..778b612 100644 --- a/react-project/src/App.jsx +++ b/react-project/src/App.jsx @@ -31,7 +31,8 @@ const jeux = [ function App() { const [recherche, setRecherche] = useState(""); - + const [total, setTotal] = useState(0); + const filtres = jeux.filter((j) => j.titre.toLowerCase().includes(recherche.toLowerCase()), ); @@ -55,9 +56,12 @@ function App() { titre={jeu.titre} console={jeu.console} annee={jeu.annee} + onLike={() => setTotal((t) => t + 1)} /> ))} +

Total de likes : {total}

+