diff --git a/src/app/quiz/page.tsx b/src/app/quiz/page.tsx index 63efdcf..0fe34b7 100644 --- a/src/app/quiz/page.tsx +++ b/src/app/quiz/page.tsx @@ -1,12 +1,12 @@ "use client"; import Loading from "@/components/loading"; -import { useEffect, useState } from "react"; +import { useEffect, useState, Suspense } from "react"; import { useSearchParams } from "next/navigation"; import { Question } from "@/types"; import QuizDisplay from "@/components/quiz-display"; -export default function Page() { +function QuizContent() { const searchParams = useSearchParams(); const username = searchParams.get("username"); const period = searchParams.get("period"); @@ -31,8 +31,8 @@ export default function Page() { setQuestions(data.questions); } }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [username, period]); + return (
{loading && } @@ -40,3 +40,11 @@ export default function Page() {
); } + +export default function Page() { + return ( + }> + + + ); +}