JSFiddle - React, Tailwind, and code Playground

by zpao

HTML

<script src="http://react.zpao.com/builds/master/latest/react-with-addons.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 Mixin = {
  componentDidMount: function() {
    console.log('Mixin');
  }
};

var CompA = React.createClass({
  mixins: [Mixin],
  componentDidMount: function() {
    console.log('CompA');
  },
  render: function() {
    return <span>A</span>;
  }
})

var CompB = React.createClass({
  componentDidMount: function() {
    console.log('CompB');
  },
  mixins: [Mixin],
  render: function() {
    return <span>B</span>;
  }
})

React.renderComponent(<div><CompA/><CompB/></div>, document.body);