overlayed icon indicating copy to clipboard operation
overlayed copied to clipboard

refactor react+es6 method syntax

Open bengreenier opened this issue 6 years ago • 0 comments

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.

bengreenier avatar Oct 04 '18 00:10 bengreenier