-
-
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
Destructuring with fallback and then reassigning in {#each}
is broken
#13822
Comments
In Svelte 4 it doesn't work either. |
This seems like a bit of an edge case. |
Note that it works as expected if you don't have a fallback: REPL |
Destructuring with fallback internally is done as derived and I assume it doesn't see changes because the array isn't stateful. Defining it with a variable will make it coarsely reactive - the change will be propagated only in the next tick. |
Could you provide a more complete code example that better resembles your use case? As others pointed out, this doesn't work in Svelte 4 either, so I'm having a hard time to understand what is actually broken between 4 and 5 - if this is related to a 4->5 discrepancy at all. |
Describe the bug
In non-runes mode, destructuring an object with a fallback and then assigning to that variable in a callback does not seem to mutate it.
When the button is clicked in the REPL, this is the output:
It should be:
Reproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: