diff options
author | 2023-05-17 10:18:04 -0400 | |
---|---|---|
committer | 2023-05-17 10:18:04 -0400 | |
commit | 3d525efc95cfb2deb5d9e04856d02965d66901c9 (patch) | |
tree | af1973aede0d2950d94b7ebfc957770be214446c /packages/integrations/react/static-html.js | |
parent | e9fc2c2213036d47cd30a47a6cdad5633481a0f8 (diff) | |
download | astro-3d525efc95cfb2deb5d9e04856d02965d66901c9.tar.gz astro-3d525efc95cfb2deb5d9e04856d02965d66901c9.tar.zst astro-3d525efc95cfb2deb5d9e04856d02965d66901c9.zip |
Prevent removal of nested slots within islands (#7093)
* Prevent removal of nested slots within islands
* Fix build errors
Diffstat (limited to 'packages/integrations/react/static-html.js')
-rw-r--r-- | packages/integrations/react/static-html.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/integrations/react/static-html.js b/packages/integrations/react/static-html.js index 9589aaed8..37fda1983 100644 --- a/packages/integrations/react/static-html.js +++ b/packages/integrations/react/static-html.js @@ -7,9 +7,10 @@ import { createElement as h } from 'react'; * As a bonus, we can signal to React that this subtree is * entirely static and will never change via `shouldComponentUpdate`. */ -const StaticHtml = ({ value, name }) => { +const StaticHtml = ({ value, name, hydrate }) => { if (!value) return null; - return h('astro-slot', { + const tagName = hydrate ? 'astro-slot' : 'astro-static-slot'; + return h(tagName, { name, suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: value }, |