score:4

Accepted answer

you're trying to use the getinitialstate lifecycle method inside your react component created using es6 classes, which isn't supported. you should change to a constructor and setting your initial state inside of it.

class menuexample extends component {
  // eslint-disable-next-line
  constructor(props) {
    super(props);
    this.state = { focused: 0 };
  }
  ...

it is explained here.


Related Query

More Query from same tag