react-native-community icon indicating copy to clipboard operation
react-native-community copied to clipboard

I am getting HTML from the backend . How can I put it in <Text> in react native

Open rajatgupta1993 opened this issue 8 years ago • 1 comments

(Current Output):

Coming Soon Shortly < br > Coming Soon Shortly < br > Coming Soon Shortly When I put in < Text> , it shows < br> tag as it is , instead of going to the next line

(Expected output):

Coming Soon Shortly

Coming Soon Shortly

Coming Soon Shortly

rajatgupta1993 avatar Aug 27 '16 08:08 rajatgupta1993

In my experience, there are two ways:

  1. Use some lib to parse your html into a component
  2. Parse/clean this string yourself with an function which will return clear string into <Text>

First option's nice. I'm using react-native-html-render

vedovato avatar Aug 29 '16 14:08 vedovato