Skip to content

Instantly share code, notes, and snippets.

@MoOx
Created September 24, 2016 03:55
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 MoOx/696ddfe00935ac8e10f27c1b93fd292f to your computer and use it in GitHub Desktop.
Save MoOx/696ddfe00935ac8e10f27c1b93fd292f to your computer and use it in GitHub Desktop.
Class method with this and no bind or no fat arrow in render
import React, { Component } from "react"
class Test extends Component {
handleThing = () => {
this.setState({
// ...
})
};
render() {
<div onClick={ this.handleClick } />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment