scroll top on component mount

This commit is contained in:
Antoine M 2024-05-13 10:27:37 +02:00
parent 9adc3194ab
commit 67ea922811

View File

@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { useGame } from "../../hooks/useGame";
import sucessIcon from "../../assets/img/icons/behaviour-type-success.svg";
@ -7,6 +7,9 @@ import { useUser } from "../../hooks/useUser";
import Loading from "../animations/Loading";
export default function GameAnwerExplanation({ questionId }) {
useEffect(() => {
document.querySelector("dialog").scrollTo(0, 0);
},[]);
const { answers, contextGameDatas, setCurrentGameModal, checkIfGameIsComplete } = useGame();
const { screensTranslations } = useUser();