JSFiddle - React, Tailwind, and code Playground
by vjeux
HTML
<script src="http://fb.me/JSXTransformer-0.10.0.js"></script>
<script src="http://fb.me/react-with-addons-0.10.0.js"></script>
<script src="http://fb.me/react-js-fiddle-integration.js"></script>
JavaScript 1.7
/** @jsx React.DOM */
var Checkbox = React.createClass({
componentDidMount: function() {
this.componentDidUpdate();
},
componentDidUpdate: function() {
this.getDOMNode().indeterminate = this.props.indeterminate;
},
render: function() {
return this.transferPropsTo(<input />);
}
});
var Hello = React.createClass({
componentDidMount: function() {
setInterval(this.forceUpdate.bind(this), 100);
},
render: function() {
return <Checkbox type="checkbox" indeterminate={Math.random() > 0.5} />;
}
});
React.renderComponent(<Hello name="World" />, document.body);