-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Twice objects invalidation in bindings #4430
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 sounds similar to #4265. |
Seems to be the same issue, if you change the svelte version in the #4265-REPL to 3.16.4, it works as expected: So, not 100% sure how everything works, but the problem seems to be here: If svelte/src/runtime/internal/Component.ts Lines 90 to 97 in 3b0c6a1
|
I have also come up with REPL containing comments and notes, maybe not exactly useful but I have decided to share. https://svelte.dev/repl/eaf17544e7ab403a9990736ccce83a59?version=3.19.1 |
When I bind the object with child component's property and use reactive declaration with it - the reactive declaration will run tripple - once on mount(it is correct) and then runs twice, but shouldn't.
Example in REPL(open the console):
There are two bindings with object and primitive type. Primitive binding doesn't run reactive statement at all, but object's binding runs twice.
https://svelte.dev/repl/1dd6381bdcbd4e179dedc6109e73ab14?version=3.18.1
Before version 3.16.5, binding with object did run statement once (after initialization one).
https://svelte.dev/repl/1dd6381bdcbd4e179dedc6109e73ab14?version=3.16.4
Expected behavior:
As I think, binding with object shouldn't invalidate object at all. Like primitive bindings.
The text was updated successfully, but these errors were encountered: