Webapp not compiling in src/components/Game/component.js
mishafeingold opened this issue · 0 comments
mishafeingold commented
This section of the tutorial has an incorrectly written if statement.
question = () => {
/* CODE GOES HERE */
let questionId = this.state.question.onCreateQuestion.id;
if(this.state.questionAvailable){
setTimeout((() => {
if(this.state.answerChosen == null){
this.answerChosen(-1);
}
if (this.state.question.onCreateQuestion.id == questionId) {
this.setState({
modalVisible: false,
questionAvailable: false,
buttonsDisabled: true,
selectedAnswerButton: null
});
});
}).bind(this), 10000);
return(
<div className="question-container">
<div className="question">
<div className="question-title-container">
<div className="question-title">{ this.state.question.onCreateQuestion.question }</div>
</div>
<div className="answers-container">
<div className="answers">
{ this.answerButtons() }
</div>
</div>
</div>
</div>
);
}
}
I believe this should be able to fix it:
question = () => {
/* CODE GOES HERE */
let questionId = this.state.question.onCreateQuestion.id;
if(this.state.questionAvailable){
setTimeout((() => {
if(this.state.answerChosen == null){
this.answerChosen(-1);
}
if (this.state.question.onCreateQuestion.id == questionId) {
this.setState({
modalVisible: false,
questionAvailable: false,
buttonsDisabled: true,
selectedAnswerButton: null
});
}
}).bind(this), 10000);
return(
<div className="question-container">
<div className="question">
<div className="question-title-container">
<div className="question-title">{ this.state.question.onCreateQuestion.question }</div>
</div>
<div className="answers-container">
<div className="answers">
{ this.answerButtons() }
</div>
</div>
</div>
</div>
);
}
}