-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reactivity problem with fromStore() and objects #13077
Comments
#13076 (comment) and the next comment.
|
I'm experiencing the same kind of issue with deeply nested reactivity when using |
Workaround are:
The |
Thank you for the workaround @brunnerh . I also found another workaround. Here's a code snippet from my project testing out Svelte 5 preview: const styleStore = fromStore(store).current
styleStore.fontSize = fontSizes[sliderValue]
store.set(styleStore) It's not pretty. I'm pretty sure most of us use svelte for the syntax sugar |
Describe the bug
When using a fromStore() with a store that hold an object, the update of the object's fields is not reported in the store, which breaks reactivity.
Ex: something like this :
Reproduction
Demo here :
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACt1TXU-DMBT9Kw0xYcQ5fGZsifHdB_VNfGDdJauWlrSXqWn636WFsaHb1Jn44Auhp-d-nXNrgoJx0EHyYAKRlxAkwVVVBeMA3yp30GvgCM1Zy1pRh6SaKlbhPBMZsrKSCskdSgWkULIk4ST2p0kbGE4HtBx3ac3pIO1G3tYC9JDdgTtBabztRqRtH_F8-LtSHeKqf_zdvdzU3Ic0CpRyyQoGyyBBVYMd94JRWQsEtRXtSe8K1o1lyItimC84ENuN1c4Ra9erl0DAq-dSKbT7-rxk1keOiOH5AnhCwvsVkOuWEI7JOuc1JOTSRtNjnXpVjpvroURWyJoeiHLjz4xP0-ry2X3TN2p7uzpk8qRDN1aGRS2oS0mYoApKEDiKiHE3GZ5t2H6K83O_DPajuUu29lVNT_dSWDLy-kUJSRc1YlNCCsoZfZ6ZvpadD2s0kpohYtO4jXYzxq7WcR1z_LmOpwu4Zbr7drcPL1GGHLrtaQbtI0Zdzsjr-5UpnjyhtVIN_E1nhjEbe7YNRK0OX1i1p7Lzaw98gmndiz7hDRQ51795BP_GQyEv_t7GR_sOq2Eti6oGAAA=
$
syntax, and incrementing the value is reactive in all components. 👍fromStore()
in runes mode, and incrementing the value is not reactive at all !fromStore()
in non-runes mode, and incrementing the value is only reactive on the current component.Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: