Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Aug 5, 2022
1 parent 9afa461 commit 1b9b78b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/astro/src/core/render/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
} from '../../@types/astro';
import type { LogOptions } from '../logger/core.js';

import { renderPage, Fragment } from '../../runtime/server/index.js';
import { Fragment, renderPage } from '../../runtime/server/index.js';
import { getParams } from '../routing/params.js';
import { createResult } from './result.js';
import { callGetStaticPaths, findPathItemByKey, RouteCache } from './route-cache.js';
Expand Down Expand Up @@ -157,10 +157,12 @@ export async function render(opts: RenderOptions): Promise<Response> {
if (typeof (mod as any).components === 'object') {
Object.assign(pageProps, { components: (mod as any).components });
}

// HACK: expose `Fragment` for all MDX components
if (typeof mod.default === 'function' && mod.default.name.startsWith('MDX')) {
Object.assign(pageProps, { components: Object.assign((pageProps?.components as any) ?? {}, { Fragment }) });
Object.assign(pageProps, {
components: Object.assign((pageProps?.components as any) ?? {}, { Fragment }),
});
}

return await renderPage(result, Component, pageProps, null, streaming);
Expand Down

0 comments on commit 1b9b78b

Please sign in to comment.