Can this function be improved performance wise?

I am using a function to wrap part of texts that contains links, emails and urls with a component that links you in the appropriate way in React Native but since this could be used for rather long texts I am wondering if you see any potential performance improvements that could be made?
  const renderTextWithLinks = (text: string): React.ReactNode => {
    const allWords = text.split(' ');
    return allWords.flatMap((word, index) => {
      if (isEmail.test(word)) {
        return (
          <TextRN key={index} onPress={() => Linking.openURL(`mailto:${word}`)} style={styles.underlineText}>
            {`${word} `}
          </TextRN>
        );
      }
      if (isPhoneNumber.test(word)) {
        return (
          <TextRN key={index} onPress={() => Linking.openURL(`tel:${word}`)} style={styles.underlineText}>
            {`${word} `}
          </TextRN>
        );
      }
      if (isUrl.test(word)) {
        return (
          <TextRN key={index} onPress={() => Linking.openURL(word)} style={styles.underlineText}>
            {`${word} `}
          </TextRN>
        );
      }
      return `${word} `;
    });
  };
Was this page helpful?