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

@@ -139,7 +139,7 @@ function renderComponentSubTree(
}
// set current rendering instance for asset resolution
setCurrentRenderingInstance(instance)
const prev = setCurrentRenderingInstance(instance)
ssrRender(
instance.proxy,
push,
@@ -151,7 +151,7 @@ function renderComponentSubTree(
instance.data,
instance.ctx
)
setCurrentRenderingInstance(null)
setCurrentRenderingInstance(prev)
} else if (instance.render && instance.render !== NOOP) {
renderVNode(
push,