You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const [correct, setCorrect] = React.useState("correct"):- as you're using correct as a boolean, it feels weird to initialise it as a string
if (correct === true) { is redundant (or would be if you were just using it as a boolean). You could just use if (correct)
Instead of putting an alert in the useEffect, why not make a component that displays "correct!" or "incorrect!" in the DOM?
You could then also display the counter (score?) on the page too! In this case you'd want to make sure you're reducing the counter number for incorrect answers
The text was updated successfully, but these errors were encountered:
Nice work overall! :). Good structure too
A few things with
QuestionContainer
:const [correct, setCorrect] = React.useState("correct")
:- as you're usingcorrect
as a boolean, it feels weird to initialise it as a stringif (correct === true) {
is redundant (or would be if you were just using it as a boolean). You could just useif (correct)
The text was updated successfully, but these errors were encountered: