astro/packages/integrations/solid/static-html.js
Fred K. Schott 6386c14d00
Astro Integration System (#2820)
* update examples

* add initial integrations

* update tests

* update astro

* update ci

* get final tests working

* update injectelement todo

* update ben code review

* respond to final code review feedback
2022-03-18 15:35:45 -07:00

12 lines
331 B
JavaScript

import { ssr } from 'solid-js/web';
/**
* 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;