Last active
March 30, 2020 17:03
-
-
Save akexorcist/f137c34be751805a458b46189f1b2e91 to your computer and use it in GitHub Desktop.
Code Snippet for https://blog.nextzy.me/เมื่อเขียน-react-แต่ดันไม่รู้เรื่อง-method-binding-ใน-react-component-6a498f3f646f
This file contains hidden or 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
| var UserCard = React.createClass({ | |
| onButtonClick: function() { | |
| ... | |
| }, | |
| render: function() { | |
| return ( | |
| <div> | |
| <button onClick={this.onButtonClick}>Confirm</button> | |
| </div> | |
| ) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment