-
-
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
Svelte uses same yield content when it's in a if block #231
Comments
This is a pretty major issue, as the following common code doesn't work:
Shows |
So changing
generator.current.parent.getUniqueName fixes the issue, because before the different yield blocks were getting the same name and so svelte was only using the 1st one.
The only thing is, I don't understand why we need to use the parent there because I'm not super familiar with this piece of code. Any advice @Rich-Harris? |
make yield renderer names globally unique
Fixed in 1.6.3, thanks (the answer was that the names need to be globally unique — it just so happened that in that case using the parent fragment's name maker had the same effect) |
I created a test repo with more info: https://github.com/PaulBGD/svelte-uses-same-yield
Comes down to:
This bug only occurs when there is a 2nd component with a yield in it and the 1st component has an if statement that uses the 2nd component in each block. The content of the yield will be the same passed from the 1st if block.
The text was updated successfully, but these errors were encountered: