Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <script src="https://fb.me/react-0.13.3.js"></script>
</head>
<body>
</body>
</html>
 
// 1. Use setState to increment timesClicked on each click
var ClickCounter = React.createClass({
  getInitialState () {
    return {
      timesClicked: 0
    };
  },
  
  handleClick () {
    // code here
  },
  
  render () {
    return <div onClick={this.handleClick}>
      {this.state.timesClicked}
    </div>;
  }
});
React.render(<ClickCounter />, document.body);
Output 300px

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

Dismiss x
public
Bin info
chantasticpro
0viewers