Exhaustive-deps warning

This commit is contained in:
Carlos Mesquita
2024-09-02 22:20:02 +01:00
parent caddf87231
commit 063a73691a

View File

@@ -76,6 +76,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
if (currentExercise === undefined && partIndex === 0 && exerciseIndex === 0) { if (currentExercise === undefined && partIndex === 0 && exerciseIndex === 0) {
setCurrentExercise(exam.parts[0].exercises[0]); setCurrentExercise(exam.parts[0].exercises[0]);
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentExercise, partIndex, exerciseIndex]); }, [currentExercise, partIndex, exerciseIndex]);
const scrollToTop = () => Array.from(document.getElementsByTagName("body")).forEach((body) => body.scrollTo(0, 0)); const scrollToTop = () => Array.from(document.getElementsByTagName("body")).forEach((body) => body.scrollTo(0, 0));