You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the initial state is { [key]: undefined }, it's committed to localStorage as "{}".
If you don't mutate it, and reload, the reactivity breaks.
You can't assign to deep variables, and you can't watch them.
Without clicking on the buttons, reload the page.
Then click on the two first buttons ( they are the ones that mutate properties of the object ).
The first button is broken until you click the third, upon which the entire object is replaced, and reactivity is revived.
Pre existing "empty" localStorage states breaks it.
If the initial state is { [key]: undefined }, it's committed to localStorage as "{}".
If you don't mutate it, and reload, the reactivity breaks.
You can't assign to deep variables, and you can't watch them.
https://codesandbox.io/s/vue-composable-localstorage-reloaded-empty-state-bug-i1yqd
https://i1yqd.csb.app/
Without clicking on the buttons, reload the page.
Then click on the two first buttons ( they are the ones that mutate properties of the object ).
The first button is broken until you click the third, upon which the entire object is replaced, and reactivity is revived.
Pre existing "empty" localStorage states breaks it.
https://codesandbox.io/s/vue-composable-localstorage-reloaded-empty-state-bug-forked-qgrsk
The text was updated successfully, but these errors were encountered: