Created
October 21, 2016 06:52
-
-
Save solebox/90d6f63af2c4ff3114991a852442ae6e to your computer and use it in GitHub Desktop.
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 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