-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
TransitionGroup doesn't render a wrapper element by default in Vue 3, it uses a Fragment #648
Comments
Moving this to the docs repo |
@LinusBorg found out this is a bug :D
And it doesn't render Or this is a vue3 docs bug |
It's a docs issue. Since we have Fragments support in Vue 3, we don't need a root element anymore for TransitionGroup. You can have one created by defining it with the
Relevant code: |
@LinusBorg yeah, I see, already updated issue description |
…ration/transition.html) and add tag to TransitionGroup (vuejs/docs#648) (#315)
When rendering server-side only children of |
I don't see how that should lead to a hydration mismatch? I think I don't get what you mean |
Admittedly (my bad), it's not the exact same case as you were talking about the default when no tag prop is passed to TransitionGroup. |
That's the part I'm having trouble understanding. I'd like a reproduction of that actually happening during SSR. If that's the case, open an issue with that reproduction in the vue-next repo. We obviously do now knowingly offer APIs that break SSR. |
Thanks for the prompt answer. I will follow your advice and open an issue over in the vue-next repo.
Can you give an example? |
You gave an example. You claim that during SSR, TransitionGroup, if provided with a If that was implemented this way knowingly by us, we would have coded something that will always break hydration. Of course we won't do such a thing, so if what you claim is true, it's a bug, not a documentation issue. |
Ah I got you. I think instead of 'now' you mean 'not'. |
Oh. Right. 🙈 |
* feat(migration): transition-group document fragment default behaviour * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/transitions-list.md * Update src/guide/migration/transition-group.md * add transition-group to config Co-authored-by: Thorsten Luenborg <t.luneborg@googlemail.com> Co-authored-by: Sarah Drasner <sarah.drasner@gmail.com>
* feat(migration): transition-group document fragment default behaviour * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/transitions-list.md * Update src/guide/migration/transition-group.md * add transition-group to config Co-authored-by: Thorsten Luenborg <t.luneborg@googlemail.com> Co-authored-by: Sarah Drasner <sarah.drasner@gmail.com>
What problem does this feature solve?
I suddenly found out that vue2
<TransitionGroup/>
component transforms into<span/>
tag.Vue2:
compiles to
Meanwhile vue3
<TransitionGroup/>
doesn't create element in DOM, so it breaks previous behaviour and old code.Vue3:
compiles to
Also Vue3:
compiles to
It moves classes from
<TransitionGroup/>
to single child.What does the proposed API look like?
We should add this info to vue3 migration guide (maybe here: https://v3.vuejs.org/guide/migration/transition.html#overview)
The fastest way to migrate: wrap your
<TransitionGroup/>
with new<span/>
:Before:
After:
UPD:
Checked vue2 docs: https://v3.vuejs.org/guide/transitions-list.html#list-transitions
And vue3 docs: https://v3.vuejs.org/guide/transitions-list.html#list-transitions
So it looks like a vue3
<transition-group/>
bug. Or v3 docs are wrong.The fastest way to fix your code: add
tag="span"
to<transition-group/>
The text was updated successfully, but these errors were encountered: