overlayed
overlayed copied to clipboard
refactor react+es6 method syntax
Per this review comment we can refactor our es6 methods to be "autobound" to the React this
instance, cleaning up code by removing the need for this.callback = this.callback.bind(this)
.
For instance:
class Ex {
constructor() {
this.method = this.method.bind(this)
}
public method() {
// do work
}
}
to
class Ex {
public method = () => {
// do work
}
}
Note: need to see how the linter + typescript feel about this, if they complain it may not be a fit.