React Base Fiddle (JSX)

Starting point for creating JSFiddles with React. This uses React with Addons.

by chantastic

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/react-with-addons.js"></script>
<script src="https://facebook.github.io/react/js/jsfiddle-integration.js"></script>

<div id="container">
    <!-- This element's contents will be replaced with your component. -->
</div>

JavaScript 1.7

var Comments
  , Comment
  , commentsData;

Comment = React.createClass({
  render() {
    return <div>{this.props.comment}</div>;
  }
});

Comments = React.createClass({
  render() {
    var comment = comment => <Comment comment={comment} />;
    
    return <div>{this.props.comments.map(comment)}</div>;
  }
});

commentsData = [
  { body: 'one' },
  { body: 'two' },
  { body: 'three' }
];

React.render(
  <Comments comments={commentsData} />,
  document.getElementById('container')
);