iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
564 stars 166 forks source link

openUrl types are not correct #208

Open citrocitrusyolo opened 6 months ago

citrocitrusyolo commented 6 months ago

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