1
我是一个初学者,并且我想将一个对象添加到数组中。反应:将一个对象添加到数组中
这里是我的代码:
而且在我的组件:
<ul>{this.props.chat.messages.map((message) =>{ return <li>{message.text}</Link></li> })
}
而我得到的错误:
Encountered two children with the same key,
的翻译:. Child keys must be unique; when two children share a key, only the first child will be used.
谢谢你的帮助。