0
有没有比使用递归模板时再次重新传递所有属性更优雅的解决方案?将属性传递给递归模板?
<!-- CommentList.js -->
<Comment comment="comment" property="one" property="two"></Comment>
<!-- Comment.js -->
<p>{comment.message}</p>
<!-- loop over comment.children (more comments, same properties) -->
<Comment comment="comment" property="one" property="two"></Comment>
<!-- end loop -->
我不确定我明白......你是否试图将所有道具转移给儿童? http://facebook.github.io/react/docs/transferring-props.html – WiredPrairie 2015-02-11 21:29:57
我试图在递归模板中重新传递相同的属性(注释包括具有来自父CommentList的所有必要属性的注释) - - >更新后的问题 – kraftwer1 2015-02-11 21:31:53
按照我提供的链接中的建议,会不会按照<注释{... this.props} />做你想做的事情? – WiredPrairie 2015-02-11 21:36:14