diff options
Diffstat (limited to 'packages/integrations/preact/src/server.ts')
-rw-r--r-- | packages/integrations/preact/src/server.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/integrations/preact/src/server.ts b/packages/integrations/preact/src/server.ts index 932cacb99..5b38ff590 100644 --- a/packages/integrations/preact/src/server.ts +++ b/packages/integrations/preact/src/server.ts @@ -27,19 +27,17 @@ async function check( useConsoleFilter(); try { - try { - const { html } = await renderToStaticMarkup.call(this, Component, props, children, undefined); - if (typeof html !== 'string') { - return false; - } - - // There are edge cases (SolidJS) where Preact *might* render a string, - // but components would be <undefined></undefined> - // It also might render an empty sting. - return html == '' ? false : !html.includes('<undefined>'); - } catch { + const { html } = await renderToStaticMarkup.call(this, Component, props, children, undefined); + if (typeof html !== 'string') { return false; } + + // There are edge cases (SolidJS) where Preact *might* render a string, + // but components would be <undefined></undefined> + // It also might render an empty sting. + return html == '' ? false : !html.includes('<undefined>'); + } catch { + return false; } finally { finishUsingConsoleFilter(); } |