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 MyTable = React.createClass({
    render: function() {
        return (
            <table>
                <thead>
                    <tr>
                        <td>Name</td>
                        <td>Job</td>
                    </tr>
                </thead>
                <tbody>
                    {this.props.records.map(function(record) {
                        return (
                            <tr>
                                <td>{record.name}</td>                    
                                <td>{record.job}</td>
                            </tr>
                        );
                    })}
                </tbody>
            </table>
        );
    }
});
 
var records = [
  {name: 'vjeux', job: 'Facebook'},
  {name: 'blib', job: 'Unknown'}
];

React.renderComponent(<MyTable records={records} />, document.body);