-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[Svelte 5] Bindings to nested fields are not immediately reactive when the target is a class field. #9661
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
Comments
This works as expected - although the behavior is surprising at first. The reason why this doesn't work in the class case is that Svelte can't see that If you put Svelte in immutable mode you'd get the same behavior in both cases |
(for clarity: we have some thoughts on how to make this behaviour less surprising, but it isn't public yet. bear with us) |
Fair enough - but combined with the fact that Runes based reactivity doesn't work for nested values outside classes either #9639, it seems to make reactivity significantly less powerful - or am I doing it all wrong? Basically, you need to use a class if you want effects to work on nested values - but then the bindings stop working. |
@dummdidumm Can I know why svelte doesn’t see that it is a |
|
Fixed by #9739 |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Bindings for nested fields are reactive when the target is a standalone value, but not immediately reactive when the target is a class field.
Reproduction
REPL
Note that the 2nd binding is semi-reactive - if you change the value in 2nd input, nothing happens, until you also change the value in the 1st input.
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: