From 1b9b78bc3ad0595ed9b4d3a6bb648c170d3b6240 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Fri, 5 Aug 2022 22:18:27 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/render/core.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts index 6c47d0a18..e5b604cba 100644 --- a/packages/astro/src/core/render/core.ts +++ b/packages/astro/src/core/render/core.ts @@ -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'; @@ -157,10 +157,12 @@ export async function render(opts: RenderOptions): Promise { 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);