Created
September 24, 2016 03:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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