【发布时间】:2018-09-03 18:38:18
【问题描述】:
好的,所以我很沮丧找到正确的解决方案,所以我在这里发布问题。给出答案会对我有很大帮助,因为我被卡住了!
状态树是这样的
this.state = {
itemList : [{
_id : 1234,
description : 'This the description',
amount : 100
}, {
_id : 1234,
description : 'This the description',
amount : 100
}],
}
问题是:
- 无法根据数组的Object更新任何特定的key 到_id
- 之前的状态应该保持不变
【问题讨论】:
标签: reactjs immutability setstate