@touchstart="touchStart(event)"
touchStart(event) {
console.log(event);
console.log("touch start");
}
Why is event returnung undefined?
@touchstart="touchStart(event)"
touchStart(event) {
console.log(event);
console.log("touch start");
}
Why is event returnung undefined?
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