Skip to content

Instantly share code, notes, and snippets.

@jcreighton
Created September 15, 2021 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcreighton/f2ddbc13239614edc1ae08d1d813680e to your computer and use it in GitHub Desktop.
Save jcreighton/f2ddbc13239614edc1ae08d1d813680e to your computer and use it in GitHub Desktop.
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