react-native-markdown-renderer
react-native-markdown-renderer copied to clipboard
heading styles broke after upgrade to RN 0.57.4
Not sure if it is just me but applyStyle.js check for display name child.type.displayName === type
is broken, because displayName is undefined always.
Possible check would be -> child.type.displayName === type || child.type.render.name === type
Same problem here with Expo 31 using RN 0.57.7. Would a PR be accepted?
You can workaround it while the pull request doesn't get merged into master creating a custom rule
like
const rules = {
heading2: (node, children, parent, styles) => {
return (
<YourCustomComponent key={getUniqueID()}>
{children[0].props.children}
</YourCustomComponent>
)
},
}
<Markdown rules={rules}>
{markdownText}
</Markdown>