JSFiddle - React, Tailwind, and code Playground

by zpao

HTML

<script src="http://react.zpao.com/builds/master/latest/react.js"></script>
<script src="http://react.zpao.com/builds/master/latest/JSXTransformer.js"></script>
<script src="http://fb.me/react-js-fiddle-integration.js"></script>

JavaScript 1.7

/** @jsx React.DOM */

var Testing = React.createClass({
    getInitialState: function() {
        return {events: []};
    },
    render: function() {
        return (
            <div
                onTouchDown={this._handleEvent}
                onClick={this._handleEvent}>
                <span>Tap me!</span>
                <ol>
                    {this.state.events.map(function(eventType) {
                        return <li>{eventType}</li>;
                    })}
                </ol>
            </div>
        );
    },
    _handleEvent: function(event) {
        this.state.events.unshift(event.type);
        this.forceUpdate();
    }
});

React.initializeTouchEvents(true);
React.renderComponent(<Testing />, document.body);