Reputation: 589
console shows this warning even key is set on the child component:
bundle.js:2215 Warning: Each child in an array or iterator should have a unique "key" prop
code so far:
var requestList = this.state.data.map(function (request,index) {
return (
<Requests key={request.id} info={request} index={index} trigger={this.triggerChildRequests}></Requests>
);
}.bind(this));
Upvotes: 1
Views: 300
Reputation: 188
Maybe request.id
is undefined, try to use index
as component's key.
var requestList = this.state.data.map(function (request,index) {
return (
<Requests key={index} info={request} index={index} trigger={this.triggerChildRequests}></Requests>
);
}.bind(this));
Upvotes: 2