From b04de83ddb2c364726eeceb6e75dca2ccd7d30f7 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 11 May 2022 16:04:50 -0600 Subject: [PATCH] fix: change metadata to options bag --- packages/astro/src/runtime/server/hydration.ts | 2 +- packages/integrations/react/client-v17.js | 2 +- packages/integrations/react/client.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/runtime/server/hydration.ts b/packages/astro/src/runtime/server/hydration.ts index dd2b2d2fcf05..4d8ab48f0b68 100644 --- a/packages/astro/src/runtime/server/hydration.ts +++ b/packages/astro/src/runtime/server/hydration.ts @@ -118,7 +118,7 @@ export async function generateHydrateScript( )}"), import("${await result.resolve(renderer.clientEntrypoint)}")]); return (el, children) => hydrate(el)(Component, ${serializeProps( props - )}, children, ${JSON.stringify(hydrate)}); + )}, children, ${JSON.stringify({ client: hydrate })}); ` : `await import("${await result.resolve(componentUrl)}"); return () => {}; diff --git a/packages/integrations/react/client-v17.js b/packages/integrations/react/client-v17.js index a2635be6b7d9..32ba875586cc 100644 --- a/packages/integrations/react/client-v17.js +++ b/packages/integrations/react/client-v17.js @@ -2,7 +2,7 @@ import { createElement } from 'react'; import { render, hydrate } from 'react-dom'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, children) => +export default (element) => (Component, props, children, { client }) => { const componentEl = createElement( Component, diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index 2236ae40bd4d..0579f4a08d3c 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -2,7 +2,7 @@ import { createElement } from 'react'; import { createRoot, hydrateRoot } from 'react-dom/client'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, children, client) => +export default (element) => (Component, props, children, { client }) => { const componentEl = createElement( Component,