-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
React hook warning when using MDX #12802
Comments
Having the same issue with 5.1.1. With the MDX-integration enabled I get this error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
Removing the mdx-integration and the error messages is gone. |
Try running |
@ascorbic, it looks like two react but with the same version (?). Here's how it looks for the example: |
Same here. I've created a clean project for that. As soon as react and mdx are both present in the astro config, using a hook triggers the warning. Changing the order of the integration does not seem to have any influence. npm ls react:
The waning only appears on the command line, not in the browser. Reproduce: |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I'm getting the react hooks warning on route change. It only shows up when I have enabled the MDX integration.
Related:
The whole message:
What's the expected result?
No warnings in the console
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-syektoew?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: