fix(runtime-core): check the DEV_ROOT_FRAGMENT flag correctly in the dev environment (#2750)

This commit is contained in:
HcySunYang 2021-02-06 02:54:59 +08:00 committed by GitHub
parent 2587f36fe3
commit 347a8798a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,11 @@ export function renderComponentRoot(
// to have comments along side the root element which makes it a fragment // to have comments along side the root element which makes it a fragment
let root = result let root = result
let setRoot: ((root: VNode) => void) | undefined = undefined let setRoot: ((root: VNode) => void) | undefined = undefined
if (__DEV__ && result.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT) { if (
__DEV__ &&
result.patchFlag > 0 &&
result.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT
) {
;[root, setRoot] = getChildRoot(result) ;[root, setRoot] = getChildRoot(result)
} }