Skip to content

mdxJsxFlowElement vs element #1969

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

You must be logged in to vote

Hey Katie!

It’s intended that explicit JSX tags can’t be changed but things from markdown can.
To illustrate why, take this:

<p className="special-paragraph">Special.</p>

Normal.

Both are paragraphs. But what should happen when a component for p is passed to add a class of normal-paragraph?
Chances are that the first one shouldn’t be changed, only the second. This shows that the previous behavior sometimes yielded unexpected results.

Your question shows that there’s something to be said for both explicit JSX and normal markdown to use the same component.
You can be explicit there though:

<Hr />

---

…assuming you change what components you pass and also pass your custom thematic break as

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by glitteringkatie
Comment options

You must be logged in to vote
0 replies
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