React Base Fiddle (JSX)

Starting point for creating JSFiddles with React. This uses React with Addons.

by vivek07mishra

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/react-with-addons.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration.js"></script>

<div id="container">
    <!-- This element's contents will be replaced with your component. -->
</div>

JavaScript 1.7

/** @jsx React.DOM */ 
var Counter = React.createClass({ 
  incrementCount: function(){ 
    this.setState({ 
      count: this.state.count + 1 
    }); 
  }, 
  getInitialState: function(){ 
    return { 
      count: 0 
    } 
  }, 
  render: function(){ 
    return ( 
      <div class="my-component"> 
        <h1>Count: {this.state.count}</h1> 
        <button type="button" onClick={this.incrementCount}>Increment</button> 
      </div> 
    ); 
  } 
}); 

React.render(<Counter/>, document.getElementById('mount-point'));