astro/packages/renderers/renderer-solid/static-html.js
2021-10-05 16:22:58 +00:00

12 lines
348 B
JavaScript

import { ssr } from 'solid-js/web/dist/server.js';
/**
* Astro passes `children` as a string of HTML, so we need
* a wrapper `astro-fragment` to render that content as VNodes.
*/
const StaticHtml = ({ innerHTML }) => {
if (!innerHTML) return null;
return ssr(`<astro-fragment>${innerHTML}</astro-fragment>`);
};
export default StaticHtml;