【发布时间】:2018-11-10 14:34:41
【问题描述】:
我不知道如何解决这个警告信息??
“警告:数组或迭代器中的每个子元素都应该有一个唯一的“key”属性。
let theComments =
this.props.state.studentCommentReducer.studentCommentReducer.map((comments) => {
return <CommentsItem key={comments.id} comments={comments} />;
});
Student: {this.props.comments.comment}
【问题讨论】:
-
是不是像把 cmets.id 改成别的一样简单?