I want to remove a key. Check this out
console.log(state);
When I do, I get {1: {here is next object}}
,
next
const { 1: deletedValue, ...newState } = state;
console.log(newState);
console.log(state);
But then I end up with
{1: {here is next object}}
{1: {here is next object}}
The removal doesn't seem to be working as expected. I'm not sure why
You asked for a more accurate depiction of the data in the comments:
state: {1: {id: 1, content: {name: "xyz", surname: "dsd"}},
2: {id: 2, content: {name: "abc", surname: "dsq"}}
}