Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Find url in text and add TouchableOpacity

I'm developing a project with React Native. If there is a url in a text, I want to find it and add TouchableOpacity. The same code works on the web, I add a href, but when I add an element in react native, it returns [object Object]. If I don't add the React Native element, it returns as normal text.

function urlifyFn(text = '') {
  if (text != '') {
    var urlRegex = /(https?:\/\/[^\s]+)/g;
    var row = text.replace(urlRegex, function (url) {
      return (
        <View>
          <TouchableOpacity onPress={() => Linking.openURL(row)}>
            <Text>{row}</Text>
          </TouchableOpacity>
        </View>
      );
    });
    return row;
  }
}

I want React Native element to be returned instead of [object Object]

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!