I am currently working on a react app, and I found having to bind this
a bit cumbersome when a component class has many functions.
Example
class Foo extends Component {
constructor(props){
super(props);
this.function1 = this.function1.bind(this);
this.function2 = this.function2.bind(this);
this.function3 = this.function3.bind(this);
}
function1() {
...
}
function2() {
...
}
function3() {
...
}
}
Is there a more efficient way to do this?