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,