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 react mdx stories #417

Merged
merged 2 commits into from
Jun 22, 2022
Merged

Fix react mdx stories #417

merged 2 commits into from
Jun 22, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Jun 22, 2022

This fixes an issue where as long as preact is installed in the monorepo, vite-plugin-mdx will default to using it, even in react projects, causing an error in mdx stories.

This uses the framework option, and only uses the preact mdx if the framework is preact, otherwise falling back to react. This was enabled by brillout/vite-plugin-mdx@b37e2cd.

I also added an mdx story in the preact example, but the styling is wrong. @maxbeatty do you know why that might be? Does storybook's emotion need to be configured to work with preact, maybe?

To test, verify that the introduction story is working in the react example as well as the preact example, and maybe vue too, for good measure.

@IanVS IanVS mentioned this pull request Jun 22, 2022
@IanVS IanVS changed the title Add mdx preact example Fix react mdx stories Jun 22, 2022
@IanVS IanVS requested a review from joshwooding June 22, 2022 03:56
@IanVS IanVS merged commit 8970641 into main Jun 22, 2022
@IanVS IanVS deleted the fix-react-mdx branch June 22, 2022 14:05
@maxbeatty
Copy link
Contributor

Thanks for digging into this!

@IanVS
Copy link
Member Author

IanVS commented Jun 22, 2022

No problem @maxbeatty. I could still use help figuring out why the styling isn't working correctly in the preact example mdx story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants