jsdf / react-native-htmlview

A React Native component which renders HTML content as native views
ISC License
2.71k stars 467 forks source link

[HELP WANTED] Inserting inside HTMLView as child #48

Closed ospfranco closed 7 years ago

ospfranco commented 8 years ago

Hey, I'm using a combination of Autolinker and HTMLView to render text.

I want to pass something like: const commentText = <p><a href="http://www.google.com" target="_blank" rel="noopener noreferrer">google.com</a></p>

and render it like:

<View style={[flexStyle, appStyles.chatBubble]}>
    <Text style={appStyles.chatBubbleText}>
       <HTMLView
            value={commentText}
         />
      </Text>
</View>

but when I place HTMLView within another tag, it does not get rendered, any idea on how to achieve this?

nobalmohan commented 7 years ago
render() {
const commentText = "<p><a href="http://www.google.com" target="_blank" rel="noopener noreferrer">google.com</a></p>";
return (){
 <View style={[flexStyle, appStyles.chatBubble]}>
    <Text style={appStyles.chatBubbleText}>
       <HTMLView value={{commentText}} />
      </Text>
</View>
}