Skip to content

Svelte 5: Sub-object losing reactivity #11069

@enyo

Description

@enyo

Describe the bug

I'm not sure if this is intended behavior, so I'm reporting to make sure.

When you destructure a $state object to a primitive value it loses reactivity. That's to be expected.

But I assumed, that I would be able to destructure a sub-object, and maintain proper reactivity when modifying this object.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE5WRTW-DMAyG_4oXTWorVXBPAWnaadddxw4thDYdJAibrVPEf18-oGVrVWmHHOzYfh-_NqyStUDG3wxT20Ywzp7alq0ZfbcuwE9Rk7Ax6r4rXCbBopMtZbnKSTat7ggMFFqROBEMUHW6gUUUj5koDIiOuNjMOp4Psi7PtT4aK0OZe3YCutkoiKTaox2eTkK5SuILh0p2PZFWoFVRy-IjNcsVpNm5M8KD_npRr_udnfBwnR38Mr4VzI1vpxYUglqgjzNrS6NLWUlRMk5dL4b12cXf-18MPeLcTHHydoRVJxNTeETaklgahzXxcPChTUxcHJymS1rCYXWPxhP_96ojz72bzu40cc6utPlzJk_Bb1p8Df8-_ABVkSoAnAIAAA==

Logs

No response

System Info

Repl

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions