-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Milestone
Description
Describe the bug
When state member variables are initialised from a class constructor, they bypass reactivity logic as an optimisation (presumably).
However, this means that if other code is added directly to the constructor that asynchronously modifies state member variables (through this.
), it does so in a way that bypasses reactivity logic.
This can by avoided by moving all logic to a member function in which reactivity logic is not bypassed, but it is not expected that this is required.
Either a fix to allow the expected behaviour, a runtime warning, or documenting the behaviour would be helpful.
Reproduction
Logs
No response
System Info
Svelte 5 Preview REPL
Severity
annoyance
aradalvand and xamir82
Metadata
Metadata
Assignees
Labels
No labels