Skip to content

Commit

Permalink
correct recursive rendering of thrown promises in async renders
Browse files Browse the repository at this point in the history
  • Loading branch information
f0x52 committed Jan 16, 2025
1 parent 24dbf7c commit 44d4505
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,21 +542,8 @@ function _renderToString(
: result;
} catch (e) {
if (!e || typeof e.then != 'function') throw e;

return e.then(() => {
const result = _renderToString(
rendered,
context,
isSvgMode,
selectValue,
vnode,
asyncMode,
renderer
);
return vnode._suspended
? BEGIN_SUSPENSE_DENOMINATOR + result + END_SUSPENSE_DENOMINATOR
: result;
}, renderNestedChildren);

return e.then(renderNestedChildren);
}
};

Expand Down

0 comments on commit 44d4505

Please sign in to comment.