Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html>
  <head>
    <script src="http://cdn.staticfile.org/react/0.12.0-rc1/react-with-addons.js"></script>
  </head>
  <body>
  </body>
</html>
 
var Example = React.createClass({
  getInitialState: function() {
    return {
      clicked: 0
    };
  },
  handleClick: function() {
    this.setState({clicked: this.state.clicked + 1});  // 1
    this.setState({clicked: this.state.clicked + 1});  // 2
  },
  render: function() {
    console.log('render');
    return <button onClick={this.handleClick}>{this.state.clicked}</button>;
  }
});
React.render(<Example />, document.body);
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jasonslyviapro
0viewers