JSFiddle - React, Tailwind, and code Playground
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 i = 0;
var Component = React.createClass({
getInitialState: function() {
return {mode: 'html'};
},
componentDidMount: function() {
setTimeout(this.setState.bind(this, {mode: 'text'}), 1000);
setTimeout(this.setState.bind(this, {mode: 'html'}), 2000);
},
render: function() {
if (this.state.mode === 'html') {
return <div dangerouslySetInnerHTML={{__html: '<b>HTML ' + (i++) + ' </b>'}}/>;
}
return <div>Text</div>;
}
});
React.renderComponent(<Component />, document.body);