iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openUrl types are not correct

citrocitrusyolo opened this issue · comments

sample repro

const rules: RenderRules = {
  link: (node, children, parent, styles, onLinkPress) => (
    <Text
      key={node.key}
      style={styles.link}
      // @ts-expect-error TS2554 the type is wrong on the package
      onPress={() => openUrl(node.attributes.href, onLinkPress)}
    >
      {children}
    </Text>
  ),
};

this appears to be due to

export function openUrl(url: string): void;

which to my understanding is https://github.com/iamacup/react-native-markdown-display/blob/master/src/lib/util/openUrl.js