Created
January 25, 2016 20:21
-
-
Save styks1987/cc03d43b56a2a569cde7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Store = require('./store'); | |
var Comment = require('./comment'); | |
module.exports = React.createClass({ | |
render: function () { | |
console.log(Comment); | |
return ( | |
<div> | |
{this.props.comments.map((comment, i) => { | |
//var commentProps = this._setComment(comment, i); | |
return <Comment key={i + '_comment'} {...comment} /> | |
})} | |
</div> | |
); | |
} | |
}); | |
// In another file | |
var React = require('react'); | |
var Moment = require('moment') | |
var Comments = require('./comments'); | |
module.exports = React.createClass({ | |
render: function () { | |
console.log(Comments); | |
return ( | |
<div className="message"> | |
<p>{this.props.id}</p> | |
<p>{this.props.text}</p> | |
<p className="caption"> | |
{this.props.user.full_name} {Moment(this.props.created).format('M/D/YY, h:mm a')} | |
</p> | |
<Comments comments={this.props.child_comments} /> | |
<div className="clearfix"></div> | |
</div> | |
) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment