Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://static.jsbin.com/js/vendor/traceur.js"></script>
<!-- uncomment for React master
<script src="http://react.zpao.com/builds/master/latest/react.min.js"></script>
-->
<script src="//fb.me/react-with-addons-0.12.1.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
// pretend these are defined elsewhere and are useful
var CommentForm = React.createClass({render: function(){ return React.createElement('div', null, 'CommentForm') }});
var CommentList = React.createClass({render: function(){ return React.createElement('div', null, 'CommentList') }})
// create factories
var [div, h1, commentForm, commentList] = [
  'div', 'h1', CommentForm, CommentList
].map(React.createFactory);
var CommentBox = React.createClass({displayName: 'CommentBox',
  render: function() {
    // use factories
    return (
      div({className: "commentBox"}, 
        h1(null, "Comments"), 
        commentList(null), 
        commentForm(null)
      )
    );
  }
});
React.render(React.createElement(CommentBox, null), document.body);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers