-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
When using the @const directive with a component that accepts slot props, as the slot prop changes & the component rerenders, the @const directive attached to it rerenders no matter what. Whilst that alone could be acceptable, the issue arrises when it doesn't trigger rerenders for its dependents, which creates desynch, especially when using side-effects.
Currently, the workaround I'm using is just to wrap what the @const directive would've had as its value, into a component, & using slot props. This is not very sustainable, once the number of directives increase.
Reproduction
https://svelte.dev/repl/80b36627ebea4c95beac69da22df90fd?version=3.58.0
In the REPL console, you can see const 1 constantly being logged, erroneously. Subsequently, even though const 1 is logged, const 2 isn't, even though it depends on a.
Logs
No response
System Info
n/a (tested fully on REPL)Severity
annoyance