-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
fix(hydration): the component vnode's el should be updated when a mismatch occurs. #12255
base: main
Are you sure you want to change the base?
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-dom
@vue/runtime-core
@vue/server-renderer
@vue/shared
@vue/compat
vue
commit: |
Maybe just re-update the el after hydateNode core/packages/runtime-core/src/renderer.ts Lines 1324 to 1333 in ed01d92
|
@@ -1328,6 +1328,10 @@ function baseCreateRenderer( | |||
parentSuspense, | |||
null, | |||
) | |||
// when data-allow-mismatch is set, the component vnode's el may be incorrect, so it should be updated | |||
if (initialVNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vnode.el
needs to be updated only if a mismatch occurs.
So this is not the proper fix. The correct fix should be in the handleMismatch
function.
- update
vnode.el
as follows:core/packages/runtime-core/src/components/Suspense.ts
Lines 896 to 897 in ed01d92
parentComponent.vnode.el = el updateHOCHostEl(parentComponent, el)
close #12253