let Comment = React.createClass({ rawMarkup: function () { let rawMarkup = marked(this.props.children.toString(), { sanitize: true }); return { __html: rawMarkup }; }, render: function () { return (

{this.props.author}

); } }); let CommentList = React.createClass({ render: function () { let commentNodes = this.props.data.map(function (comment) { return ( {comment.text} ); }); return (
{commentNodes}
); } }); let CommentForm = React.createClass({ render: function () { return (
Hello, world! I am a CommentForm.
); } }); let CommentBox = React.createClass({ getInitialState: function () { return { data: [] }; }, componentDidMount: function () { $.ajax({ url: this.props.url, dataType: "json", cache: false, success: function (result) { console.log('Received frop api: ', result); this.setState({ data: result }); }.bind(this), error: function (xhr, status, err) { console.error(this.props.url, status, err.toString()); }.bind(this) }); }, render: function () { return (

Comments

); } }); ReactDOM.render( , document.getElementById("content") );