-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
Describe the bug
When a reactive statement is triggered in a child component, if another non-primitive dependency of that statement is bound to the parent component, the reactive statement will be run an extra time.
Ran into this when trying to use the Broadcast Channel API to sync bound Svelte variables across tabs. The extra call would cause infinite loops in sending messages between tabs.
Similar to #5720 but without the slot.
One workaround is to add <svelte:options immutable/>
to the child component.
Reproduction
https://svelte.dev/repl/2b38363381f6400b9b9a8a870fbb7b24?version=3.55.1
Logs
No response
System Info
System:
OS: Linux 6.1 Arch Linux
CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics
Memory: 27.82 GB / 30.74 GB
Container: Yes
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.19.0 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 8.19.2 - /usr/bin/npm
Browsers:
Chromium: 108.0.5359.124
Firefox: 108.0.2
Severity
annoyance