Corrections dépendantes useEffect
This commit is contained in:
		@@ -148,7 +148,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
      fetch(`/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json())
 | 
			
		||||
        .then(data => setResultats(data))
 | 
			
		||||
    }
 | 
			
		||||
  }, [])
 | 
			
		||||
  }, [typeResultats, zoneId])
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    const parBloc = {}
 | 
			
		||||
@@ -167,7 +167,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
 | 
			
		||||
    setVoixParBloc(parBloc)
 | 
			
		||||
    setVoixParNuance(parNuance)
 | 
			
		||||
  }, [resultats])
 | 
			
		||||
  }, [blocs, nuances, listes, resultats])
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    const categories = []
 | 
			
		||||
@@ -234,7 +234,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setSiegesParListe(sieges)
 | 
			
		||||
  }, [resultats, retirerSeuil])
 | 
			
		||||
  }, [listes, resultats, retirerSeuil])
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    const parBloc = {}
 | 
			
		||||
@@ -253,7 +253,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
 | 
			
		||||
    setSiegesParBloc(parBloc)
 | 
			
		||||
    setSiegesParNuance(parNuance)
 | 
			
		||||
  }, [siegesParListe])
 | 
			
		||||
  }, [blocs, nuances, listes, siegesParListe])
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    const data = []
 | 
			
		||||
@@ -268,7 +268,7 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    setDataSieges(data)
 | 
			
		||||
  }, [siegesParBloc, siegesParNuance, grouperParBloc])
 | 
			
		||||
  }, [blocs, nuances, siegesParBloc, siegesParNuance, grouperParBloc])
 | 
			
		||||
 | 
			
		||||
  const compositonOptions = {
 | 
			
		||||
    chart: {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user