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/react/server-v17.js | |
parent | 7373d61cdcaedd64bf5fd60521b157cfa4343558 (diff) | |
download | astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.gz astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.tar.zst astro-059d00bd5d4bd2b64cb7d321d1ebf9c1ba44c625.zip |
[ci] format
Diffstat (limited to 'packages/integrations/react/server-v17.js')
-rw-r--r-- | packages/integrations/react/server-v17.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/integrations/react/server-v17.js b/packages/integrations/react/server-v17.js index 5d747a832..8613ef01a 100644 --- a/packages/integrations/react/server-v17.js +++ b/packages/integrations/react/server-v17.js @@ -2,7 +2,7 @@ import React from 'react'; import ReactDOM from 'react-dom/server.js'; import StaticHtml from './static-html.js'; -const slotName = str => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); +const slotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); const reactTypeof = Symbol.for('react.element'); function errorIsComingFromPreactComponent(err) { @@ -59,11 +59,11 @@ function renderToStaticMarkup(Component, props, { default: children, ...slotted slots[name] = React.createElement(StaticHtml, { value, name }); } // Note: create newProps to avoid mutating `props` before they are serialized - const newProps = { + const newProps = { ...props, ...slots, children: children != null ? React.createElement(StaticHtml, { value: children }) : undefined, - } + }; const vnode = React.createElement(Component, newProps); let html; if (metadata && metadata.hydrate) { |