How to render mdx from a constant using custom components? #2455
Answered
by
ChristianMurphy
elVengador
asked this question in
Q&A
-
for example, I have a constant const myMdx = "<MyButton>Hi</MyButton>" Now I want to render |
Beta Was this translation helpful? Give feedback.
Answered by
ChristianMurphy
Mar 11, 2024
Replies: 2 comments 4 replies
-
You should try it in playground:
More details is here: https://mdxjs.com/docs/using-mdx/#components |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can use |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the default return from evaluate, is a react component.
When you render it on the page, pass that component a
components={}
prop.avoid using Provider when possible, it is more complex than is needed in most cases.