-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
bind:this
produces unwanted read of $props
during unmount
#14980
Comments
It looks like it happens with a props spread. Without the spread, everything works as expected. Optional chaining in the derived also solves this. example without attribute spread with spread compiles to: Input($$anchor, $.spread_props(() => $.get(attributes), {
get value() {
return value().value;
},
set value($$value) {
value(value().value = $$value, true);
}
})); without spread: Input($$anchor, {
get title() {
return $.get(attributes).title;
},
get value() {
return value().value;
},
set value($$value) {
value(value().value = $$value, true);
}
}); |
Thanks for the reply.
|
@trueadm it seems that it's inconsistent behavior where a component that is being unmounted behaves differently causing an error if a spread is used vs no spread when props become undefined. wonder if this can be fixed? The issue happens inside the |
Describe the bug
reproduction: click on
Del
button to get an error in consoleexpected: no error
Current behavior is understandable from reactive system point of view, but I was very surprised as a consumer of a library that uses code like in the
Input.svelte
component.Reproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: