-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5: compiler may falsy consider variable as non-reactive #9860
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
Comments
This one feels like a won't-fix (or maybe even a working-as-designed) to me. If supporting this requires any additional runtime code for people not using a custom |
The original case is more tricky, but I kinda agree. |
What about this case with a Date? I suppose |
@7nik That's because Svelte doesn't treat |
Closing this as I think this isn't something we need to fix. |
Describe the bug
The compiler may consider the variable non-reactive if no explicit calls of methods. However, an object may have a custom stringification method that reads a signal. Such methods are
toString
,toJSON
,valueOf
, andSymbol.toPrimitive
.Reproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: