diff options
Diffstat (limited to 'packages/integrations/preact/client.js')
-rw-r--r-- | packages/integrations/preact/client.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/integrations/preact/client.js b/packages/integrations/preact/client.js index e2f4ca803..78d8720f0 100644 --- a/packages/integrations/preact/client.js +++ b/packages/integrations/preact/client.js @@ -1,13 +1,14 @@ import { h, render } from 'preact'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, { default: children, ...slotted }) => { - if (!element.hasAttribute('ssr')) return; - for (const [key, value] of Object.entries(slotted)) { - props[key] = h(StaticHtml, { value, name: key }); - } - render( - h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), - element - ); -}; +export default (element) => + (Component, props, { default: children, ...slotted }) => { + if (!element.hasAttribute('ssr')) return; + for (const [key, value] of Object.entries(slotted)) { + props[key] = h(StaticHtml, { value, name: key }); + } + render( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), + element + ); + }; |