Created
October 15, 2015 14:44
-
-
Save glortho/3d64d4158c8f85987ae2 to your computer and use it in GitHub Desktop.
autobind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass extends React.Component { | |
@autobind | |
myMethod() { | |
console.log( `${this.props} works now` ); | |
} | |
} | |
@autobind | |
class MyClass extends React.Component { | |
myMethod() { | |
console.log( `${this.props} works now` ); | |
} | |
myOtherMethod() { | |
console.log( `${this.props} works here too` ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment