@astrojs/react
Version:
Use React components within Astro
20 lines (19 loc) • 454 B
JavaScript
import { createElement as h } from "react";
const StaticHtml = ({
value,
name,
hydrate = true
}) => {
if (!value) return null;
const tagName = hydrate ? "astro-slot" : "astro-static-slot";
return h(tagName, {
name,
suppressHydrationWarning: true,
dangerouslySetInnerHTML: { __html: value }
});
};
StaticHtml.shouldComponentUpdate = () => false;
var static_html_default = StaticHtml;
export {
static_html_default as default
};