fix(lint): 4 erreurs ESLint corrigées — split SimulationFlowProvider, hook conditionnel, ref render, setState effect
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
de69b3ff16
commit
79bbbdc4e8
10 changed files with 82 additions and 50 deletions
|
|
@ -17,7 +17,8 @@ import { MemoryRouter } from 'react-router-dom'
|
|||
import React from 'react'
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { useSimulation } from '../useSimulation'
|
||||
import { SimulationFlowProvider, useSimulationFlow } from '../../state/SimulationFlowProvider'
|
||||
import { SimulationFlowProvider } from '../../state/SimulationFlowProvider'
|
||||
import { useSimulationFlow } from '../../state/simulationFlow'
|
||||
import {
|
||||
createSimulation,
|
||||
getSimulationState,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useSimulationFlow } from '../state/SimulationFlowProvider'
|
||||
import { useSimulationFlow } from '../state/simulationFlow'
|
||||
|
||||
export function useSimulation() {
|
||||
const navigate = useNavigate()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ export function useTimer(dureeMinutes: number, active: boolean): TimerState {
|
|||
const dureeSecondes = Math.max(0, Math.floor(dureeMinutes * 60))
|
||||
const [secondesRestantes, setSecondesRestantes] = useState(dureeSecondes)
|
||||
const dureeRef = useRef(dureeSecondes)
|
||||
dureeRef.current = dureeSecondes
|
||||
useEffect(() => {
|
||||
dureeRef.current = dureeSecondes
|
||||
}, [dureeSecondes])
|
||||
|
||||
useEffect(() => {
|
||||
if (!active) return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue