[MDX] Docs: Custom components for imported mdx#5055
[MDX] Docs: Custom components for imported mdx#5055christian-hackyourshack wants to merge 4 commits intowithastro:mainfrom
Conversation
|
sarah11918
left a comment
There was a problem hiding this comment.
Reviewing on behalf of Docs Maintainers.
All the small edits look fine! I've left a suggestion re: the new content, but am happy to let @bholmesdev edit/approve as he sees fit. (I believe he was part of the original conversation, so tagging Ben, with the context, in.)
f6dd542 to
738d79c
Compare
|
I cannot find, why the mergeability check fails. I already tried to rebase the branch to the latest main, but it still fails. Any hints? |
|
@christian-hackyourshack it's likely an error in the CI script and not the PR. The changes looks good to me 👍 cc @matthewp |
| When rendering imported MDX content, custom components can be passed via the `components` prop. | ||
|
|
||
| You can also use exported custom components from an MDX file, by importimg them along with `Content` and pass them into the same `components` prop. |
There was a problem hiding this comment.
Thanks for tagging me on this one @sarah11918! I'll admit this is pretty tricky behavior, and the example describes it really well. Wanted to clear up the wording to say "no, the export trick doesn't work unless you do this." Also want to add "see the example" since it's pretty necessary to understand how it works. Lmk if that works.
| When rendering imported MDX content, custom components can be passed via the `components` prop. | |
| You can also use exported custom components from an MDX file, by importimg them along with `Content` and pass them into the same `components` prop. | |
| When rendering imported MDX content, custom components can be passed via the `components` prop. | |
| Note: An MDX file's exported components will _not_ be used unless you manually import and pass them via the `components` property! See the example below: |
bholmesdev
left a comment
There was a problem hiding this comment.
Left a comment on wording around import / export components. Otherwise, thanks for this important docs change 👏
Hm, that is pretty odd. I'd probably try another rebase since it's been a few days and we have some patches in. Otherwise, I'll ping core next week to see what's up |
- whitespace at line end - blank lines around lists and code fences - casing of internal references
- fixed docs to clearly state, that custom components **must** be passed as props - extended the example to show, the additional potential of passing components as props and how to reuse exported components
Accepting incoming suggestions from Sarah. Thanks! Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
738d79c to
8ff4028
Compare
|
Replaced this with PR #5190 that does not fail mergeability check. |
Changes
It's just a documentation change, hence a changeset is not required.
Closes #5027
Testing
It's just a documentation change, hence tests are not required.
Docs
It's just a documentation change.