Created
October 21, 2016 06:42
-
-
Save solebox/5c8786e4c4d1eb294068add400de07bc 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({test: "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