Просмотр исходного кода

fix(ssr): always hydrate children for HMR (#5406)

fix #5405
Anthony Fu 4 лет назад
Родитель
Сommit
0342fae8ad
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      packages/runtime-core/src/hydration.ts

+ 2 - 1
packages/runtime-core/src/hydration.ts

@@ -273,7 +273,8 @@ export function createHydrationFunctions(
     // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
     const forcePatchValue = (type === 'input' && dirs) || type === 'option'
     // skip props & children if this is hoisted static nodes
-    if (forcePatchValue || patchFlag !== PatchFlags.HOISTED) {
+    // #5405 in dev, always hydrate children for HMR
+    if (__DEV__ || forcePatchValue || patchFlag !== PatchFlags.HOISTED) {
       if (dirs) {
         invokeDirectiveHook(vnode, null, parentComponent, 'created')
       }