object updating incorrectly
I feel like i'm missing something fundamental here. when I add a new entry into object
b
it resets to an empty object upon a subsequent request. Can anyone help?
1 Reply
I don't really understand what you're trying to do.
You're never writing anything to b. You're just defining it doing
const b = {};
and spread it afterwards doing const updatedState = { ...b, andsoon, ... }
b never contains any props that could be spread