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

Impossible to pass key blocks through slots #7408

Closed
alextana opened this issue Mar 31, 2022 · 4 comments · Fixed by #7422
Closed

Impossible to pass key blocks through slots #7408

alextana opened this issue Mar 31, 2022 · 4 comments · Fixed by #7422
Labels
bug compiler Changes relating to the compiler

Comments

@alextana
Copy link

Describe the bug

I'm trying to use a key block to rerender a component based on a condition, but I noticed that if a component is nested it looks like it doesn't actually get re-rendered

Reproduction

https://svelte.dev/repl/990bc381eae748a2822c3d07304d14c2?version=3.46.5

the behaviour I'm expecting is to get Component3 to log 'mount' when reset changes

Logs

No response

System Info

System:
    OS: macOS 12.3
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 16.49 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.2 - /usr/local/bin/node
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.60
    Firefox: 98.0.2
    Safari: 15.4

Severity

annoyance

@dummdidumm dummdidumm added bug compiler Changes relating to the compiler labels Mar 31, 2022
@kindoflew
Copy link
Contributor

kindoflew commented Apr 1, 2022

@alextana Interestingly, if you pass the key into the nested component as a prop, it works as you expect it to: https://svelte.dev/repl/28bfa9addc014a8586ea88a03ed1e80e?version=3.46.5

@alextana
Copy link
Author

alextana commented Apr 1, 2022

Yeah, that's interesting and it works well enough for me to close this, thanks a lot @kindoflew :)

@alextana alextana closed this as completed Apr 1, 2022
@Mlocik97
Copy link
Contributor

Mlocik97 commented Apr 2, 2022

even if it's possible when it's passed as prop, can we let this open, so we can fix original issue in compiler?

@alextana
Copy link
Author

alextana commented Apr 2, 2022

even if it's possible when it's passed as prop, can we let this open, so we can fix original issue in compiler?

fair point, I'll reopen

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

Successfully merging a pull request may close this issue.

4 participants