From 95e560ec41359cfd2b10d8ea80bbd15993e5e7c9 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 27 May 2022 14:14:28 -0500 Subject: [PATCH] fix(preact): ignore hydrate roots --- packages/integrations/preact/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/integrations/preact/client.js b/packages/integrations/preact/client.js index 5ece5ddb2..6ff40d2ae 100644 --- a/packages/integrations/preact/client.js +++ b/packages/integrations/preact/client.js @@ -1,8 +1,10 @@ import { h, render } from 'preact'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, children) => +export default (element) => (Component, props, children) => { + if (!element.hasAttribute('ssr')) return; render( h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), element ); +}