perf(ssr): avoid unnecessary async overhead

This commit is contained in:
Evan You
2020-01-26 16:13:12 -05:00
parent 8c892e0392
commit 297282a812
2 changed files with 43 additions and 22 deletions

View File

@@ -337,7 +337,9 @@ function setupStatefulComponent(
if (isPromise(setupResult)) {
if (__SSR__) {
// return the promise so server-renderer can wait on it
return setupResult
return setupResult.then(resolvedResult => {
handleSetupResult(instance, resolvedResult, parentSuspense)
})
} else if (__FEATURE_SUSPENSE__) {
// async setup returned Promise.
// bail here and wait for re-entry.