JSFiddle - React, Tailwind, and code Playground

by vjeux

HTML

<script src="http://fb.me/react-js-fiddle-integration.js"></script>

JavaScript 1.7

/** @jsx React.DOM */

var Hello = React.createClass({
    getInitialState: function() {
        return {counter: 0};
    },
    onClick: function() {
        this.setState({counter: this.state.counter + 1});
        this.setState({counter: this.state.counter + 1});
    },
    render: function() {
        return <button onClick={this.onClick}>{this.state.counter}</button>;
    }
});
 
React.renderComponent(<Hello name="World" />, document.body);