Skip to content
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

Multi-level-nested components breaks when top level is destroyed #625

Closed
bobslaede opened this issue Jun 9, 2017 · 3 comments · Fixed by #626
Closed

Multi-level-nested components breaks when top level is destroyed #625

bobslaede opened this issue Jun 9, 2017 · 3 comments · Fixed by #626
Labels

Comments

@bobslaede
Copy link

Having multiple levels of nested components, will break when destroying the top level.
If you have a wrapper component, inside of another component, and you destroy the top component it will break.
What happens is that it does destroy on one component, and that sets the reference to null, and then it tries to run .unmount() on it afterwards.

Example component:

Top component.html

  <Level1 />

Level1.html

  <Level2>
    <Level3 />
  </Level2>

Level2.html

  <div class="some-wrapper">
    {{yield}}
  </div>

Level3.html

  <div class="some-content">hello world</div>

Link to REPL:
https://svelte.technology/repl?version=1.22.2&gist=d0f22cc02f00b018d9e5529d935fc45a

@bobslaede bobslaede changed the title Multi-level-nested Multi-level-nested components breaks when top level is destroyed Jun 9, 2017
@bobslaede
Copy link
Author

I have just tried this in an earlier version of Svelte, 1.21.0, and it did work in that version:

https://svelte.technology/repl?version=1.21.0&gist=d0f22cc02f00b018d9e5529d935fc45a

@Rich-Harris Rich-Harris added the bug label Jun 9, 2017
Rich-Harris added a commit that referenced this issue Jun 9, 2017
Rich-Harris added a commit that referenced this issue Jun 11, 2017
Rich-Harris added a commit that referenced this issue Jun 11, 2017
Unmount `yield` fragments in parent's unmount method, not destroy
@Rich-Harris
Copy link
Member

This is fixed in 1.22.3 — thanks

@bobslaede
Copy link
Author

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants