score:5

Accepted answer

Try to bind the function inside the constructor like this:

this.isLetterInWord = this.isLetterInWord.bind(this);
this.fillWord = this.fillWord.bind(this)
this.handleGuess = this.handleGuess.bind(this);

score:2

Here you are defining class properties, which is currently (I think) is stage-3 proposal. In other words it is not supported by default. May be because of this you are getting errors. You can use class-properties-transform plugin for Babel to add support of this syntax though if you want to .

isLetterInWord = (letter) => {
  }

  fillWord = () => {

  }

Try defining methods as and see if it works

isLetterInWord(letter) {

}

Related Query

More Query from same tag