fix(ssr): properly update currentRenderingInstance state during ssr

fix #2863
This commit is contained in:
Evan You
2021-03-26 14:00:03 -04:00
parent 9036f88d83
commit 8c3c14a0ff
4 changed files with 51 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ export function renderComponentRoot(
} = instance
let result
setCurrentRenderingInstance(instance)
const prev = setCurrentRenderingInstance(instance)
if (__DEV__) {
accessedAttrs = false
}
@@ -207,7 +207,7 @@ export function renderComponentRoot(
result = createVNode(Comment)
}
setCurrentRenderingInstance(null)
setCurrentRenderingInstance(prev)
return result
}