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 MyRadio = React.createClass({
    getInitialState: function() {
        return {radio: true};
    },
    toggleRadio: React.autoBind(function() {
        this.setState({radio: !this.state.radio});
    }),
    render: function() {
        return (
            <div>
                <input type="radio" checked={this.state.radio} onClick={this.toggleRadio} />
                {this.state.radio ? 'Checked!' : 'Not checked'}
            </div>
        );
    }
});
 
React.renderComponent(<MyRadio />, document.body);