Setting content of <ReactMarkdown> element #1199
-
How would I set the content of a element? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Welcome @chill31!
A recommendation would be to create a sandbox with an example of what you are trying, along with answering the questions above. Without the above answer, I can just read between the lines of what you may want.
|
Beta Was this translation helpful? Give feedback.
Okay,
As a general React note, I'd highly recommend avoiding modifying React managed content using manual DOM selectors.
It can cause conflicts, overrides, and unexpected renders.
If you need to modify something inside the content React manages, use a component (potentially using
Context
or another state manager to cross multiple layers), to allow any updates to be managed by React, avoiding the above potential issues with direct DOM manipulation.The way to do that in content within
react-markdown
is with thecomponents
prop and using directives.