hookstate
hookstate copied to clipboard
The initial is mutated
When a state is created, one could pass in an inital value. If that initial value is an object, it is later mutated when calling set or merge.
Repro: https://codepen.io/vbuch/pen/BaxzeZY?editors=0011
I'm fine with just having this documented. But it took me quite some time to figure where my data gets messed up.
yes, hookstate works on mutable object
documented in concepts https://hookstate.js.org/docs/getting-started