You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...it's very likely that when Whenever changes, you don't want the new component to have the value of foo from the old component imposed upon it. But if you try to clear the value...
...then the SomeNewComponent instance is initialised with foo: undefined rather than being able to use its default value, which is what you want in that situation. The workaround is somewhat hacky:
I'd argue that the current behaviour is a bug, and that undefined values should be deleted from the state object automatically. Outside of the <svelte:component> case, I don't think it would result in any different outcomes.
The text was updated successfully, but these errors were encountered:
Would it make sense to have a this.del('key') that explicitly removes a key from state? (Though in all honestly, I can't think of when I've actually needed this.)
In the following case...
...it's very likely that when
Whenever
changes, you don't want the new component to have the value offoo
from the old component imposed upon it. But if you try to clear the value......then the
SomeNewComponent
instance is initialised withfoo: undefined
rather than being able to use its default value, which is what you want in that situation. The workaround is somewhat hacky:I'd argue that the current behaviour is a bug, and that
undefined
values should be deleted from the state object automatically. Outside of the<svelte:component>
case, I don't think it would result in any different outcomes.The text was updated successfully, but these errors were encountered: