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
Start with show=true, comp=Foo. Instance correctly contains the props and state of the component. Now do comp=undefined (or any falsy value, according to docs), the component is unmounted from DOM, state is removed from the instance object, but the rest (such as export function and various internal methods) remains on the object from the last comp before the falsy value.
In the repl linked below, this is checked by calling the exported function - in console you can see it repeatedly logging.
Now if you do show=false, the component is uninitialized and instance becomes null - same as when you have a normal component with bind:this. Now if you do show=true again, instance remains null, until you change comp to an actual component again.
I'd expect that the component should be fully removed and bind:this={instance} set to null as soon as the this={comp} is unset (set to falsy value).
Related to #1489 (old, then fixed - was svelte v2?)
Describe the bug
Start with
show=true
,comp=Foo
. Instance correctly contains the props and state of the component. Now docomp=undefined
(or any falsy value, according to docs), the component is unmounted from DOM, state is removed from the instance object, but the rest (such asexport function
and various internal methods) remains on the object from the lastcomp
before the falsy value.In the repl linked below, this is checked by calling the exported function - in console you can see it repeatedly logging.
Now if you do
show=false
, the component is uninitialized andinstance
becomesnull
- same as when you have a normal component withbind:this
. Now if you doshow=true
again,instance
remainsnull
, until you changecomp
to an actual component again.I'd expect that the component should be fully removed and
bind:this={instance}
set to null as soon as thethis={comp}
is unset (set to falsy value).Related to #1489 (old, then fixed - was svelte v2?)
Reproduction
https://svelte.dev/repl/c477b15230e347e19436325f2589665c?version=3.43.2
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: