Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Throwback React
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