Created
September 15, 2021 16:29
-
-
Save jcreighton/f2ddbc13239614edc1ae08d1d813680e to your computer and use it in GitHub Desktop.
Throwback React
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
import React from 'react'; | |
var Button = React.createClass({ | |
getDefaultProps: function() { | |
return { | |
onClick: function() { console.log('Throwback React') } | |
} | |
}, | |
handleOnClick: function() { | |
this.props.onClick(); | |
}, | |
render: function() { | |
return ( | |
<button onClick={this.handleOnClick}>Click me</button> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment