-
Notifications
You must be signed in to change notification settings - Fork 75
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
Share custom components in nested MDX files #227
Share custom components in nested MDX files #227
Conversation
Hi @kentcdodds, can you check out the PR when you have a moment. Your feedback would be great and maybe the PR will be merged. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handy! This is not a very common usecase though so I would prefer to put it just before the Known Issues section.
@kentcdodds Just ran across this - do you think it's not common? My gut feel says that it would be the most common use case. Currently when you have the following simple setup, it breaks:
import Partial from './2.mdx'
<Partial />
# Partial content
Some content that is shared across multiple pages
<SomeComponentFromProvider /> {/* 💥 */} |
🤷♂️ I'd still like the docs for this moved down. |
@kentcdodds , thanks for the review! I changed the position and moved it before the "Known Issues" section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stellar. Thanks!
🎉 This PR is included in version 10.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #195
What:
This pull request adds a Readme guide to make sure custom components are accessible in nested MDX files.
Why:
With the current behaviour, passing custom components to nested MDX files is leading to unexpected rendering issues. This solution and Readme guide allows to share custom components across the MDX structure.
How:
MDXProvider
from@mdx-js/react
Checklist: