From 44d450507575a55ead42abf18a65a4381d148621 Mon Sep 17 00:00:00 2001 From: f0x Date: Thu, 16 Jan 2025 17:37:58 +0100 Subject: [PATCH] correct recursive rendering of thrown promises in async renders --- src/index.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/index.js b/src/index.js index f6530f4..9c69683 100644 --- a/src/index.js +++ b/src/index.js @@ -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); } };