Skip to content

Instantly share code, notes, and snippets.

@ruffle1986
Created October 18, 2017 15:52
Show Gist options
  • Save ruffle1986/f2d0850b846f48e7196a58fca9ca6d76 to your computer and use it in GitHub Desktop.
Save ruffle1986/f2d0850b846f48e7196a58fca9ca6d76 to your computer and use it in GitHub Desktop.
import React from 'react';
class MyComponent extends React.Component {
handleClick() {
const { data } = this.state;
this.setState({
data: data + 1
});
}
render() {
return (
<button onClick={this.handleClick.bind(this)}>
Click me!
</button>);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment