[ci] yarn format
This commit is contained in:
parent
1e01251454
commit
00cdbc4a46
3 changed files with 3 additions and 8 deletions
|
@ -185,12 +185,7 @@ export interface AstroComponentMetadata {
|
||||||
componentExport?: { value: string; namespace?: boolean };
|
componentExport?: { value: string; namespace?: boolean };
|
||||||
}
|
}
|
||||||
|
|
||||||
type AsyncRendererComponentFn<U> = (
|
type AsyncRendererComponentFn<U> = (Component: any, props: any, children: string | undefined, metadata?: AstroComponentMetadata) => Promise<U>;
|
||||||
Component: any,
|
|
||||||
props: any,
|
|
||||||
children: string | undefined,
|
|
||||||
metadata?: AstroComponentMetadata
|
|
||||||
) => Promise<U>;
|
|
||||||
|
|
||||||
export interface Renderer {
|
export interface Renderer {
|
||||||
check: AsyncRendererComponentFn<boolean>;
|
check: AsyncRendererComponentFn<boolean>;
|
||||||
|
|
|
@ -51,7 +51,7 @@ React('Includes reactroot on hydrating components', async () => {
|
||||||
const div = $('#research');
|
const div = $('#research');
|
||||||
assert.equal(div.attr('data-reactroot'), '', 'Has the hydration attr');
|
assert.equal(div.attr('data-reactroot'), '', 'Has the hydration attr');
|
||||||
assert.equal(div.html(), 'foo bar <!-- -->1');
|
assert.equal(div.html(), 'foo bar <!-- -->1');
|
||||||
})
|
});
|
||||||
|
|
||||||
React('Throws helpful error message on window SSR', async () => {
|
React('Throws helpful error message on window SSR', async () => {
|
||||||
const result = await runtime.load('/window');
|
const result = await runtime.load('/window');
|
||||||
|
|
|
@ -37,7 +37,7 @@ function check(Component, props, children) {
|
||||||
function renderToStaticMarkup(Component, props, children, metadata) {
|
function renderToStaticMarkup(Component, props, children, metadata) {
|
||||||
const vnode = h(Component, { ...props, children: h(StaticHtml, { value: children }), innerHTML: children });
|
const vnode = h(Component, { ...props, children: h(StaticHtml, { value: children }), innerHTML: children });
|
||||||
let html;
|
let html;
|
||||||
if(metadata.hydrate) {
|
if (metadata.hydrate) {
|
||||||
html = renderToString(vnode);
|
html = renderToString(vnode);
|
||||||
} else {
|
} else {
|
||||||
html = reactRenderToStaticMarkup(vnode);
|
html = reactRenderToStaticMarkup(vnode);
|
||||||
|
|
Loading…
Reference in a new issue