I have a typescript 2 class that targets ES5. I'm getting the err in the subject line in the console when I run it. The switch statement works fine, but increment() and decrement() methods don't execute.
class MyClass extends React.Component{
...
increment() {
console.log('increment()')
...
}
decrement() {
console.log('decrement()')
...
}
buttonClick(btn) {
console.log(btn)
switch (btn) {
case "prev":
console.log('switch prev')
this.decrement();
//this.decrement;
break;
default:
console.log('switch next')
this.increment();
//this.increment; eliminates err but method still doesnt execute
break;
}
}
}