diff options
author | 2022-06-23 15:12:46 +0000 | |
---|---|---|
committer | 2022-06-23 15:12:46 +0000 | |
commit | 059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625 (patch) | |
tree | 9b0d289c9fb3df8dd50eff8f6176f8117c0f6084 /packages/integrations/solid/server.js | |
parent | 7373d61cdcaedd64bf5fd60521b157cfa4343558 (diff) | |
download | astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.gz astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.zst astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.zip |
[ci] format
Diffstat (limited to 'packages/integrations/solid/server.js')
-rw-r--r-- | packages/integrations/solid/server.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/integrations/solid/server.js b/packages/integrations/solid/server.js index 92b614012..2398ec317 100644 --- a/packages/integrations/solid/server.js +++ b/packages/integrations/solid/server.js @@ -1,6 +1,6 @@ import { renderToString, ssr, createComponent } from 'solid-js/web'; -const slotName = str => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); +const slotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); function check(Component, props, children) { if (typeof Component !== 'function') return false; @@ -15,14 +15,14 @@ function renderToStaticMarkup(Component, props, { default: children, ...slotted slots[name] = ssr(`<astro-slot name="${name}">${value}</astro-slot>`); } // Note: create newProps to avoid mutating `props` before they are serialized - const newProps = { + const newProps = { ...props, ...slots, // In Solid SSR mode, `ssr` creates the expected structure for `children`. children: children != null ? ssr(`<astro-slot>${children}</astro-slot>`) : children, - } + }; const html = renderToString(() => createComponent(Component, newProps)); - return { html } + return { html }; } export default { |