Skip to content

Inconsistent MDX rendering between pages and <Content> #5027

@christian-hackyourshack

Description

@christian-hackyourshack

What version of astro are you using?

1.4.6

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

linux

Describe the Bug

If you render an MDX page directly, you can export const components = { h1: Title } and get your h1-headings rendered with your custom component. The docs say, you can also pass components in via the components prop (https://docs.astro.build/en/guides/integrations-guide/mdx/#custom-components-with-imported-mdx), but actually it works only if you pass them in via the prop. Have a look at the following repro:

I think, this is not according to the docs, inconsistent and hence unintuitive.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-cvbuxz-ys5fyv?file=src/pages/mdx-through.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: mdxIssues pertaining to `@astrojs/mdx` integration

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions