Skip to content

Commit

Permalink
Remove astro core hack of passing Fragment to MDX pages
Browse files Browse the repository at this point in the history
No longer needed as this is fixed for all MDX content now within the MDX integration
  • Loading branch information
delucis committed Dec 3, 2022
1 parent cb597b6 commit 4754e30
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/astro/src/core/render/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { LogOptions } from '../logger/core.js';
import type { RenderContext } from './context.js';
import type { Environment } from './environment.js';

import { Fragment, renderPage as runtimeRenderPage } from '../../runtime/server/index.js';
import { renderPage as runtimeRenderPage } from '../../runtime/server/index.js';
import { attachToResponse } from '../cookies/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { getParams } from '../routing/params.js';
Expand Down Expand Up @@ -112,13 +112,6 @@ export async function renderPage(mod: ComponentInstance, ctx: RenderContext, env
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 }),
});
}

const response = await runtimeRenderPage(
result,
Component,
Expand Down

0 comments on commit 4754e30

Please sign in to comment.