Description
Describe the bug
There is an unexpected reactive statement call (aka. $:
) on variable assignment in other conditional reactive statement. This is happening only when there is an assignment inside reactive statement that is expected to be triggered if an exported object prop changes (which is also checked in another reactive statement).
To Reproduce
Please check the following repl - https://svelte.dev/repl/58570a9e05a240f591a76b4eeab09598?version=3.30.0
It consists of 4 different scenarios inside 4 separate components. Only TEST 1 fails (check the console output).
Expected behavior
I expect the first reactive statement to not be triggered by unrelated assignments in another reactive statement.
Or at least, please provide an explanation why is behaving like that.
Information about your Svelte project:
- Fedora 33
- Chrome 87.0.4280.66 (Official Build) (64-bit)
- Svelte ^3.30.0
- Rollup ^2.33.3
Severity
The bug is not easily detected and it took me a while before I was able to isolate it. I've already refactored several of my components by using the approach similar to TEST 4 from the repl.