react-native-markdown-renderer
react-native-markdown-renderer copied to clipboard
Native crash when nesting Views within Text
In my current project, the markdown which is provided to me is not always "clean" it sometimes has a list within a list or an image within inline text, etc.
The issue comes from having bloc content within text content which tries to render a View within a Text node. This turns into a native crash from the rendering bridge which cannot be caught in JS.
The way I fixed it was by providing an inline: true parameter to the state which allows me to detect such issues an thus avoid native crashes.
Unfortunately I don't have the time to create a pull request for the library but if you find this solution useful, here is a gist showing how I implemented it. Please note that the code is written in Typescript.
I had faced this issue and after checking my code, I see that I overrode the paragraph rule with a Text component.