0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-13 22:11:20 -05:00
astro/packages/renderers/renderer-solid/static-html.js
Ryan Carniato f8d1a35ace
Add hydration to Solid renderer (#1479)
* feat: add hydration to Solid renderer

* fix: intersection observer, move script to the end
2021-10-05 12:20:51 -04:00

12 lines
349 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;