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

fix #5405
This commit is contained in:
Anthony Fu 2022-02-12 16:24:19 +08:00 committed by GitHub
parent 15adf251ab
commit 0342fae8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,7 +273,8 @@ export function createHydrationFunctions(
// e.g. <option :value="obj">, <input type="checkbox" :true-value="1"> // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
const forcePatchValue = (type === 'input' && dirs) || type === 'option' const forcePatchValue = (type === 'input' && dirs) || type === 'option'
// skip props & children if this is hoisted static nodes // 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) { if (dirs) {
invokeDirectiveHook(vnode, null, parentComponent, 'created') invokeDirectiveHook(vnode, null, parentComponent, 'created')
} }