[ci] yarn format
This commit is contained in:
parent
f8d1a35ace
commit
fb0ec06239
2 changed files with 8 additions and 9 deletions
|
@ -8,14 +8,13 @@ function check(Component, props, children) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderToStaticMarkup(Component, props, children) {
|
function renderToStaticMarkup(Component, props, children) {
|
||||||
const html = renderToString(
|
const html = renderToString(() =>
|
||||||
() =>
|
createComponent(Component, {
|
||||||
createComponent(Component, {
|
...props,
|
||||||
...props,
|
// In Solid SSR mode, `ssr` creates the expected structure for `children`.
|
||||||
// In Solid SSR mode, `ssr` creates the expected structure for `children`.
|
// In Solid client mode, `ssr` is just a stub.
|
||||||
// In Solid client mode, `ssr` is just a stub.
|
children: ssr(`<astro-fragment>${children}</astro-fragment>`),
|
||||||
children: ssr(`<astro-fragment>${children}</astro-fragment>`),
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
return { html: html + `<script>window._$HYDRATION||(window._$HYDRATION={events:[],completed:new WeakSet})</script>` };
|
return { html: html + `<script>window._$HYDRATION||(window._$HYDRATION={events:[],completed:new WeakSet})</script>` };
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { ssr } from 'solid-js/web/dist/server.js';
|
||||||
*/
|
*/
|
||||||
const StaticHtml = ({ innerHTML }) => {
|
const StaticHtml = ({ innerHTML }) => {
|
||||||
if (!innerHTML) return null;
|
if (!innerHTML) return null;
|
||||||
return ssr(`<astro-fragment>${innerHTML }</astro-fragment>`);
|
return ssr(`<astro-fragment>${innerHTML}</astro-fragment>`);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default StaticHtml;
|
export default StaticHtml;
|
||||||
|
|
Loading…
Reference in a new issue