Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuestionContainer #11

Open
VirtualDOMinic opened this issue May 31, 2019 · 1 comment
Open

QuestionContainer #11

VirtualDOMinic opened this issue May 31, 2019 · 1 comment

Comments

@VirtualDOMinic
Copy link

Nice work overall! :). Good structure too

A few things with QuestionContainer:

  • 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
@VirtualDOMinic
Copy link
Author

The above are just points to consider in the context of a larger refactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant