Skip to content

Is there any plugin that can turn jsx code into code playground? #1902

Answered by wooorm
aweiu asked this question in Q&A
Discussion options

You must be logged in to vote

A new thread, but responding to #1902 (reply in thread).

The biggest problem with your approach: JSX is not MDX. If you want JSX, don’t use MDX. If you want MDX, don’t use ```jsx. Use Babel or so when you want to evaluate JS(X).

Further problems with your code:

  • You are using MDX in MDX. This is unrelated to what you want to do (turning code into a playground)
  • The code for the editor component on our website is here
  • The—hastily written—plugin used on our website to enhance certain code blocks in MDX files, is here

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@aweiu
Comment options

@ChristianMurphy
Comment options

@aweiu
Comment options

Comment options

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

Answer selected by ChristianMurphy
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