Skip to content

Instantly share code, notes, and snippets.

@solebox
Created October 21, 2016 06:52
Show Gist options
  • Save solebox/90d6f63af2c4ff3114991a852442ae6e to your computer and use it in GitHub Desktop.
Save solebox/90d6f63af2c4ff3114991a852442ae6e to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
class App extends React.Component {
constructor(){
super();
this.state = {text: "click to change"};
}
ouch = () => {
this.setState({text: "woot"});
}
render() {
return <div>
<p>{this.state.text}</p>
<button onClick={this.ouch}>Yo</button>
</div>
}
}
var app = document.getElementById('app');
ReactDOM.render(<App />, app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment