Skip to content

Evaluate React Markdown String with JSX Components? #2323

Discussion options

You must be logged in to vote

Welcome @ScottPierce! 👋

Evaluate React Markdown String with JSX Components?

Sure, you could wrap it as a component or any other abstraction you wanted to.
Why do you want to abstract it?

So I've surmised that the mdx runtime module is deprecated, and that the new MDX evaluate function is the way to go.

Correct

We are aware that we will need to using something like VM2 with timeouts to do this securely.

If you are interacting with untrusted content, yes.
You will want as many safe guards as possible.

If I have a static string of markdown with JSX, is there an easier way for me to render the content inside of a react component?

The simplest and least abstract way to to use the resul…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@ScottPierce
Comment options

@ChristianMurphy
Comment options

@wooorm
Comment options

@ScottPierce
Comment options

@wooorm
Comment options

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