Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:astro-mdx-component-rendering #12963

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

admirsaheta
Copy link
Contributor

Changes

  • Fixed the React invalid hook call warning when using MDX and React integrations together in Astro.
  • Updated the check function to correctly render React components using jsx and renderJSX, ensuring hooks are called within the proper context.
  • Removed the direct component invocation (Component({...})), which was causing React hooks to break.
  • Ensured compatibility with both React and MDX components without needing to import React.

Testing

  • Manually tested by navigating between routes to confirm the React hook warning no longer appears.
  • Verified that both React and MDX components render correctly with dynamic props and slots.
  • No automated tests added since this is primarily a runtime integration fix, but manual checks cover the issue.

Docs

  • No documentation updates required since this change is internal and does not affect public APIs.

Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 260a840

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 the pkg: integration Related to any renderer integration (scope) label Jan 10, 2025
@admirsaheta
Copy link
Contributor Author

Not sure why Linux CI is failing..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant