Fix: React hydration failure (#3094)
* fix: react hydration failure * chore: changeset
This commit is contained in:
parent
6d0b0597bd
commit
564caf24c2
2 changed files with 7 additions and 2 deletions
5
.changeset/clean-cherries-bow.md
Normal file
5
.changeset/clean-cherries-bow.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Expose "metadata" to component integrations renderToStaticMarkup function
|
|
@ -260,7 +260,7 @@ Did you mean to enable ${formatList(probableRendererNames.map((r) => '`' + r + '
|
|||
// We already know that renderer.ssr.check() has failed
|
||||
// but this will throw a much more descriptive error!
|
||||
renderer = matchingRenderers[0];
|
||||
({ html } = await renderer.ssr.renderToStaticMarkup(Component, props, children));
|
||||
({ html } = await renderer.ssr.renderToStaticMarkup(Component, props, children, metadata));
|
||||
} else {
|
||||
throw new Error(`Unable to render ${metadata.displayName}!
|
||||
|
||||
|
@ -279,7 +279,7 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr
|
|||
if (metadata.hydrate === 'only') {
|
||||
html = await renderSlot(result, slots?.fallback);
|
||||
} else {
|
||||
({ html } = await renderer.ssr.renderToStaticMarkup(Component, props, children));
|
||||
({ html } = await renderer.ssr.renderToStaticMarkup(Component, props, children, metadata));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue