Skip to content

feat(mdx): add TypeScript types for Content components prop#14591

Merged
matthewp merged 5 commits intomainfrom
claude/investigate-astro-issue-011CUJzAzC4bZ5oJVmmmUqBu
Oct 22, 2025
Merged

feat(mdx): add TypeScript types for Content components prop#14591
matthewp merged 5 commits intomainfrom
claude/investigate-astro-issue-011CUJzAzC4bZ5oJVmmmUqBu

Conversation

@matthewp
Copy link
Contributor

@matthewp matthewp commented Oct 20, 2025

Changes

Testing

N/A, type only

Docs

Adds proper TypeScript support for passing custom components to MDX Content component via the components prop.

Changes:
- Add MDXContentProps interface defining the components prop
- Add MDXContent type that extends AstroComponentFactory with typed props
- Update MDX render type to use MDXContent instead of plain function
- Maintains link to base AstroComponentFactory type via intersection

This addresses part of issue #14490 by providing TypeScript intellisense and type checking for the components prop when using await render().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2025

🦋 Changeset detected

Latest commit: e728491

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) docs pr labels Oct 20, 2025
Adds changeset documenting the new TypeScript support for the components prop on MDX Content component.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 20, 2025

CodSpeed Performance Report

Merging #14591 will not alter performance

Comparing claude/investigate-astro-issue-011CUJzAzC4bZ5oJVmmmUqBu (e728491) with main (577d051)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (c96711d) during the generation of this report, so 577d051 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@matthewp matthewp marked this pull request as ready for review October 20, 2025 20:14
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting for docs!

matthewp and others added 3 commits October 21, 2025 08:01
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changeset looks great! 🎉

@matthewp matthewp merged commit 3e887ec into main Oct 22, 2025
23 checks passed
@matthewp matthewp deleted the claude/investigate-astro-issue-011CUJzAzC4bZ5oJVmmmUqBu branch October 22, 2025 12:12
@astrobot-houston astrobot-houston mentioned this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passing components to <Content /> when using await render() is undocumented, lacks type support, and differs from MDXProvider

5 participants