For nested updates without mutation, spread at each level you need to change.
const user = {
name: "Alice",
address: { city: "Seattle", zip: "98101" }
};
const updated = {
...user,
address: { ...user.address, city: "Portland" }
};
Spread the outer object, then spread and update the nested one.