Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda