react-native-markdown-renderer icon indicating copy to clipboard operation
react-native-markdown-renderer copied to clipboard

heading styles broke after upgrade to RN 0.57.4

Open a-sandris opened this issue 6 years ago • 2 comments

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

a-sandris avatar Oct 29 '18 18:10 a-sandris

Same problem here with Expo 31 using RN 0.57.7. Would a PR be accepted?

cseelus avatar Nov 05 '18 13:11 cseelus

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>

gimoteco avatar Feb 18 '19 21:02 gimoteco