JSFiddle - React, Tailwind, and code Playground

HTML

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

JavaScript 1.7

var Text1 = React.createClass({
    componentDidMount: function() {
       console.log("text 1 mounted");
    },
    
    render: function() {
        return <p>Hello</p>;
    }
});

var Text2 = React.createClass({
    componentDidMount: function() {
       console.log("text 2 mounted");
    },
   
    render: function() {
        return <p>World</p>;
    }
});

var Container = React.createClass({
    
    getInitialState: function() {
        return {
            type: 1
        };
    },
    
    render: function() {
        var content = null;
        if (this.state.type == 1) {
            content = <Text1 />;
        } else {
            content = <Text2 />;
        }
        return (
            <div>
                {content}
                <button onClick={this.swap}>Click me!</button>
            </div>
        );
    },
    
    swap: function() {
        nextType = this.state.type == 1 ? 2 : 1;
        this.setState({type: nextType});
    }
});

 
React.render(<Container />, document.body);