Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time. Cannot retrieve contributors at this time
14 lines (14 sloc) 409 Bytes
var React = require('react')
var App = React.createClass({
getInitialState: function () { return { n: 0 } },
render: function () {
return <div>
<h1>clicked {this.state.n} times</h1>
<button onClick={this.handleClick}>click me!</button>
</div>
},
handleClick: function () {
this.setState({ n: this.state.n + 1 })
}
})
React.render(<App />, document.querySelector('#content'))
You can’t perform that action at this time.