From 2c0f2c4aca3a733e878eae9687dd04a1ebd3c3e1 Mon Sep 17 00:00:00 2001 From: ronan Date: Tue, 8 Mar 2022 11:26:31 +0100 Subject: [PATCH] fixed: missing CSS of sub-components when rendering asynchronously --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 49045b1..9d5618e 100644 --- a/src/index.js +++ b/src/index.js @@ -138,7 +138,10 @@ export const renderAsync = curry(createRenderer)( renderComponentAsync(rendererPayload => getOnlyHTMLFromRenderer(rendererPayload, true)) ) export const renderAsyncFragments = curry(createRenderer)( - renderComponentAsync(rendererPayload => getFragmentsFromRenderer(rendererPayload, true)) + renderComponentAsync(rendererPayload => { + rendererPayload.css = [...CSS_BY_NAME.values()].join('\n') + return getFragmentsFromRenderer(rendererPayload, true) + }) ) export const fragments = curry(createRenderer)(getFragmentsFromRenderer) export const render = curry(createRenderer)(getOnlyHTMLFromRenderer)