import { Components, registerComponent } from 'meteor/vulcan:core'; import React, { PropTypes, Component } from 'react'; class CommentsNode extends Component { renderComment(comment) { return ( ) } renderChildren(children) { return (
{children.map(comment => )}
) } render() { const comment = this.props.comment; const children = this.props.comment.childrenResults; return (
{this.renderComment(comment)} {children ? this.renderChildren(children) : null}
) } } CommentsNode.propTypes = { comment: React.PropTypes.object.isRequired, // the current comment }; registerComponent('CommentsNode', CommentsNode);