react-native-community
react-native-community copied to clipboard
I am getting HTML from the backend . How can I put it in <Text> in react native
(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
In my experience, there are two ways:
- Use some lib to parse your html into a component
- 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