The error seems to be one of mutating some immutable reference.
(该错误似乎是使某些不可变的引用发生变异的原因之一。)
I would try something like this. (我会尝试这样的事情。)
const customers = state.filteredCustomers;
const updatedCustomers = customers.map( customer => ({
...customer, addresses: customer.addresses.map( address => ({ ...address, selected: false
}));
return {
...state,
filteredCustomers: { ...state.filteredCustomers, ...updatedCustomers },
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…