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
We have the following situation: Component receives a store via prop a. The component also has a local variable b which is assigned the value of a in response to some event. However when this happens anything that accesses $b does not get updated.
I've simplified the situation in the repl linked below and what stood out to me is that b is not initialized as $.mutable_state(). So this might be less about stores and more about b not being detected as mutable.
Interestingly it works within a single component.
In our real world example we receive an observable from a SvelteKit page data loader and we assign this observable to another local variable once another promise is done loading.
I've simplified the situation in the repl linked below and what stood out to me is that b is not initialized as $.mutable_state(). So this might be less about stores and more about b not being detected as mutable.
Interestingly it works within a single component.
Describe the bug
We have the following situation: Component receives a store via prop
a
. The component also has a local variableb
which is assigned the value ofa
in response to some event. However when this happens anything that accesses$b
does not get updated.I've simplified the situation in the repl linked below and what stood out to me is that
b
is not initialized as$.mutable_state()
. So this might be less about stores and more aboutb
not being detected as mutable.Interestingly it works within a single component.
In our real world example we receive an observable from a SvelteKit page data loader and we assign this observable to another local variable once another promise is done loading.
This code works in Svelte 4.
Reproduction
https://svelte.dev/playground/a6ca4f7f1ed84860b98793a571f9ff4d?version=5.1.11
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: