Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created October 21, 2017 03:37
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 thebigredgeek/9cd72e083f6bae469b9985f4d5d39815 to your computer and use it in GitHub Desktop.
Save thebigredgeek/9cd72e083f6bae469b9985f4d5d39815 to your computer and use it in GitHub Desktop.
common class stuff in cs
import React, { PureComponent } from 'react';
import { autobind } from 'core-decorators';
export default class Button extends PureComponent {
@autobind
_handleOnClick (e) {
e.preventDefault();
console.log('I was clicked!');
}
render () {
return <button onClick={this._handleOnClick}>Click meh!</button>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment