Skip to content

Commit 4afdab3

Browse files
📝 (app/exam/page.tsx): update initial currentQuestionIndex state to 1 instead of 0 for better user experience
✅ (app/exam/page.tsx): fix a bug where the initial question index was set to 0, causing an error on first render
1 parent a162e69 commit 4afdab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/exam/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const Exam: NextPage<{ searchParams: { url: string; name: string } }> = ({
3939
useTimer({ minutes: minutes, seconds: seconds });
4040
const [currentQuestion, setCurrentQuestion] = useState<Question>();
4141
const [revealExam, setRevealExam] = useState<boolean>(false);
42-
const [currentQuestionIndex, setCurrentQuestionIndex] = useState<number>(0);
42+
const [currentQuestionIndex, setCurrentQuestionIndex] = useState<number>(1);
4343
const [countAnswered, setCountAnswered] = useState<number>(0);
4444
const { data, loading, error } = useQuery(questionsQuery, {
4545
variables: { range: 30, link: url },

0 commit comments

Comments
 (0)