-
-
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
Update binding prop in component trigger twice reaction. #5144
Comments
I'm not convinced this is a bug. By using |
I removed |
https://svelte.dev/repl/b245bd85f01043e9b5c37270398f463c?version=3.16.4
and https://svelte.dev/repl/b245bd85f01043e9b5c37270398f463c?version=3.16.5
|
Haven't take a deep look, but probably related to #3180 |
@dishuostec thanks - that's a bit clearer now. #3180 relates to stores, but if there is some shared logic there, then it makes sense that it might be the same root cause. |
Fixed in 3.24.1 - https://svelte.dev/repl/b245bd85f01043e9b5c37270398f463c?version=3.24.1 |
This is not fixed when the binding prop is used as an argument of a function: https://svelte.dev/repl/5b37ba40c8854d86a9dab9ace0b6b861?version=3.24.1 |
@Conduitry I can confirm it's not fixed in 3.29.7 when binding prop is used as an argument as @pwwang states. |
Describe the bug
When update binding prop within a component, reactive statement in parent component processed twice.
App.svelte
Foo.svelte
Logs
To Reproduce
It seems 3.16.5 introduced the bug.
https://svelte.dev/repl/b245bd85f01043e9b5c37270398f463c?version=3.16.5
3.16.4 is ok.
https://svelte.dev/repl/b245bd85f01043e9b5c37270398f463c?version=3.16.4
Expected behavior
Run reactive statement once.
The text was updated successfully, but these errors were encountered: