Skip to content

Instantly share code, notes, and snippets.

@alissonbrunosa
Last active August 8, 2016 14:27
Show Gist options
  • Save alissonbrunosa/64ac8481a40ead11972443310a49bcf3 to your computer and use it in GitHub Desktop.
Save alissonbrunosa/64ac8481a40ead11972443310a49bcf3 to your computer and use it in GitHub Desktop.
import React from 'react';
let {Component, PropTypes} = React;
export default class CoolComponent extends Component {
handler = (e) => {
// Do somthing cool here
}
render() {
return <div onClick={this.handler}></div>;
}
}
import React from 'react';
let {Component, PropTypes} = React;
export default class CoolComponent extends Component {
constructor(props) {
super(props);
this.handler = this.handler.bind(this);
}
handler(e) {
// Do somthing cool here
}
render() {
return <div onClick={this.handler}></div>;
}
}
import React from 'react';
let {Component, PropTypes} = React;
export default class CoolComponent extends Component {
handler(e) {
// Do somthing cool here
}
render() {
return <div onClick={this.handler.bind(this)}></div>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment