I'm using ReactMarkdown component (https://github.com/rexxars/react-markdown).
It works correct. Except that all output is wrapped with a div.
After research i found the solution:
My Solution:
ReactMarkdown accepts a prop "renderers". You can pass an object with keys for every node type. And when you set the key "root" to React.Fragment it renders all flat. Without the wrapping div:
<ReactMarkdown source={myMdString} renderers={{ root: React.Fragment }} />
The latest version does not support custom root. According to sources it uses div if there is a className property and React.Fragment otherwise.
So in my case I had to remove the className
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With