0
@touchstart="touchStart(event)"

touchStart(event) {
      console.log(event);
      console.log("touch start");
    }

Why is event returnung undefined?

Salil Rajkarnikar
  • 588
  • 1
  • 7
  • 26

1 Answers1

0

Events are executed in a different context from which they are defined. Hence we need to bind them to the object which it is attached to. React code will have a lot of these binding statements. Look it up for more details

why do you need to bind a function in a constructor

noob7
  • 820
  • 9
  • 18