0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/.changeset/afraid-cups-deliver.md
Emanuele Stoppa 9c0c8492d9
feat(container): client hydration (#11486)
* fix: prevent client hydration when rendering via Container API

* revert change that is not needed

* skip client directives via option

* reword changeset

* Fix types of react server.d.ts

* add new API

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2024-07-18 16:28:52 +01:00

538 B

astro
patch

Adds a new function called addClientRenderer to the Container API.

This function should be used when rendering components using the client:* directives. The addClientRenderer API must be used after the use of the addServerRenderer:

const container = await experimental_AstroContainer.create();
container.addServerRenderer({renderer});
container.addClientRenderer({name: '@astrojs/react', entrypoint: '@astrojs/react/client.js'});
const response = await container.renderToResponse(Component);