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

openUrl types are not correct

Open citrocitrusyolo opened this issue 1 year ago • 0 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

citrocitrusyolo avatar Feb 15 '24 04:02 citrocitrusyolo