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

281
Vistas
How to display a text body with html tags, in React Native?

I have an api that returns some texts from a popular website in my country. You can think of these texts as user's comments. But these comments can includes links ( tag) and also like "< /hr />" tags. Some of them looks like this;

enter image description here

so basically I want an idea about how to manage these kind of texts when we want to display it in React Native?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Maybe this will answer your question:

const regex = /<[^>]*>/mgi
const text = "A text with <strong>html tags</strong>"
const text_without_tags = text.replace(regex, "")
// text_without_tags = 'A text with html tags'

The regular expresion gets every tags in a string (with their attributes). The method replace in this example will replace the tags that the regex got by "" (so nothing).

However, if you want to keep the tags, but only change them into JSX tags, use react-html-parser.

I'm not sure if I understood your goal.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use react-native-rich-editor to display the text if you want to keep the html tags

about 4 years ago · Juan Pablo Isaza Denunciar
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