React Base Fiddle (JSX, latest)

Starting point for creating JSFiddles with React. This uses React with Addons and the latest build from the master branch)

by aniketmhatre88

HTML

<script src="http://react.zpao.com/builds/master/latest/react-with-addons.js"></script>
<script src="http://react.zpao.com/builds/master/latest/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>

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

Babel + JSX

class Toggle extends React.Component {
	constructor(props) {
	  super(props);
  	this.state = {
    	isToggleOn: true
    };
    this.handleClick = this.handleClick.bind(this);
  }
	
  handleClick() {
  	this.setState(prevState => {
    	isToggleOn: !prevState.isToggleOn
    });
  }
  
	render() {
  	return (
    	<button onClick={this.handleClick}>
        {this.state.isToggleOn ? 'ON' : 'OFF'}
      </button>
    );
  }
}

ReactDOM.render(
	<Toggle />,
  document.getElementById('root')
);