-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Svelte 5: Should prop fallbacks based on other props be reactive? #12337
Comments
I think being explicit (as what the current direction of things are, and I love it), is better. Direct "vanilla" assignments to variables being reactive would kind of break my expectations of svelte-5 reactivity system. thoughts? |
No they shouldn't be reactive. The fallback value is meant as a fixed initializer when something else is undefined. It becoming reactive would be confusing and harder to opt out of, whereas using |
Describe the bug
It is possible to define property fallbacks that use other properties like this:
The fallback is only evaluated once, so if the property the fallback value is based on changes, there will be no update.
(Workarounds using
$derived
are possible.)Reproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: