我有一个具有以下功能的function本机应用程序: this.setState({deletedIndex:index, cachedCart:this.state.Cart2000, });我的问题是,如果我也在更新Cart的状态,deletedIndex和cachedCart就不会更新。但是,如果我删除了Cart: this
我在React应用程序中使用react-addons-update npm包,并特别希望使用update()方法在对象数组中插入新对象。我想在items数组中第一项和第二项之间插入一个新项。我已经尝试过了:insertItem(){ item_title: "in between foo and bar" this.setState({