如何将对象添加到react挂钩?我想把迈克尔和菲利普都关在州钩里。export const app = () => { name: "michael", const name = "Philip"; setState(...state, //How do I add the object with name
在我的状态下,我希望更新对象数组中第一项的对象属性。对象属性没有改变,即使我正在采取步骤来确保不变性。'apple'}// console.log(copyFruits[0)] = {a: true, b: 2, c: 'apple'}
this.setStatewhere the first item, apple, has a : false inste