Skip to content

How to use CodeBlock component in custom MDX loader? #4438

Answered by slorber
phuctm97 asked this question in Q&A
Discussion options

You must be logged in to vote

The @theme/CodeBlock component is provided by the classic theme and we have the MDXProvider that tells MDX to use it for code blocks instead of the regular HTML <code> element.

You probably don't apply the MDX provider in your code

<MDXProvider components={MDXComponents}>{children}</MDXProvider>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@phuctm97
Comment options

Answer selected by phuctm97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants