Skip to content

MDX runtime - render MDX on the client side with create react app - MDX for data exchange #1705

Discussion options

You must be logged in to vote

I am working on a project where I want to use MDX files for data exchange with create react app.
And which approach would you recommend to use to continue?

Could you expand more on your use case and why you want to send components dynamically to the client?
Are you rendering user generated content? Or files written by yourself/your team?
Would serverside rendering or static file rendering work as an alternative?

The warnings say that it is not the recommended way to use MDX. So which is the correct way to use MDX to render while runtime?

Using @mdx-js/runtime is the equivalent of using eval. It can run any code.
Either use it with content that you trust completely.
Or sandbox the code…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@doldsimo
Comment options

@doldsimo
Comment options

@tmkasun
Comment options

@wooorm
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants