Open oliverjam opened 5 years ago
Similarly to Oli, I noticed you were using a string
"correct" as the initial value for your state:
https://github.com/FAC-Sixteen/b-b/blob/master/src/components/questionContainer/index.js#L9
When the type of the state is always going to be a boolean, it's a good idea to initialise it to a boolean too :) In this case false
would had been a good initial state.
You can generally eliminate a lot of
if
/else
boilerplate by leveraging the fact that the strict equality comparison (===
) will return a boolean.E.g. you could replace this:
https://github.com/FAC-Sixteen/b-b/blob/e6b0f9727623e79c8c8b7efcfc64969a8d85e591/src/components/questionContainer/index.js#L11-L15
with just