Corrections dépendantes useEffect

This commit is contained in:
Emmy D'Anello 2024-06-10 00:41:26 +02:00
parent 3193c920ec
commit 67894a80c3
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 5 additions and 5 deletions

View File

@ -148,7 +148,7 @@ export default function Election2024({typeResultats = "france"}) {
fetch(`/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json()) fetch(`/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json())
.then(data => setResultats(data)) .then(data => setResultats(data))
} }
}, []) }, [typeResultats, zoneId])
useEffect(() => { useEffect(() => {
const parBloc = {} const parBloc = {}
@ -167,7 +167,7 @@ export default function Election2024({typeResultats = "france"}) {
setVoixParBloc(parBloc) setVoixParBloc(parBloc)
setVoixParNuance(parNuance) setVoixParNuance(parNuance)
}, [resultats]) }, [blocs, nuances, listes, resultats])
useEffect(() => { useEffect(() => {
const categories = [] const categories = []
@ -234,7 +234,7 @@ export default function Election2024({typeResultats = "france"}) {
} }
setSiegesParListe(sieges) setSiegesParListe(sieges)
}, [resultats, retirerSeuil]) }, [listes, resultats, retirerSeuil])
useEffect(() => { useEffect(() => {
const parBloc = {} const parBloc = {}
@ -253,7 +253,7 @@ export default function Election2024({typeResultats = "france"}) {
setSiegesParBloc(parBloc) setSiegesParBloc(parBloc)
setSiegesParNuance(parNuance) setSiegesParNuance(parNuance)
}, [siegesParListe]) }, [blocs, nuances, listes, siegesParListe])
useEffect(() => { useEffect(() => {
const data = [] const data = []
@ -268,7 +268,7 @@ export default function Election2024({typeResultats = "france"}) {
} }
} }
setDataSieges(data) setDataSieges(data)
}, [siegesParBloc, siegesParNuance, grouperParBloc]) }, [blocs, nuances, siegesParBloc, siegesParNuance, grouperParBloc])
const compositonOptions = { const compositonOptions = {
chart: { chart: {