I’m trying to display an article from a database that contains react-native tags, for example:
const text = <Text>This the text which includes a <Text onPress={() => { this.props.navigation.navigate("mb0_WebView"); }) >Link</Text>;
Of course, once rendered if showed the tags. So I installed react-native-render-html
but it still shows part of the code.
My ultimate goal is to display articles but turn hyperlinks into onPress tags that opens a webview slide (which will contain the linked content). I like it better than having links open the default browser.
What are my options here?
Thanks!
[SOLVED]
Using react-native-htmlview
with
goCheckUrl = () => {
this.props.navigation.navigate("webview");
};
<HTMLView
value={this.state.headline}
stylesheet={styles}
onLinkPress={url => this.goCheckUrl()}
/>