summaryrefslogtreecommitdiff
path: root/packages/integrations/solid/static-html.js
blob: 9f969eac90bbd918a9e99fa4e22f22245b1a5a61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;