循环后无法再次调用组件,显示错误“不变违规:标签无效”

时间:2017-08-09 04:19:45

标签: reactjs components

我创建了通过父组件上的props传递的组件,并在map循环中使用组件,但是如果我在循环后再次调用它则显示错误Invariant Violation: Invalid tag:

{ PropsPassedComponent: propsPassedComponent } = this.props

<Wrapper>
 {dataList.map((data) => (
  <PropsPassedComponent data={data} key={data.id}>
 ))}
 <PropsPassedComponent last={true} key={dataList.length}> {/* <-- if I called Component agian here, it's show error */}
</Wrapper>

感谢您的考虑,请告诉我您是否需要更多信息。

0 个答案:

没有答案
相关问题