trying to understand how to add a like total that works

This commit is contained in:
2026-06-24 11:41:52 +02:00
parent 82fe5d7085
commit b5906c3f92
+5 -1
View File
@@ -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)}
/>
))}
<p> Total de likes : {total}</p>
<section id="spacer"></section>
<Footer />
</>