React-native-render-html: Link of url can't click

Created on 24 Feb 2018  路  10Comments  路  Source: meliorence/react-native-render-html

i got a problem with link url,
the url is showing in page component but can't clicking or directing open browser
how to solve this issue?

question

Most helpful comment

You probably want to take a look at : onLinkPress
You can implement it such as : onLinkPress: (evt, href) => { Linking.openURL(href); }

All 10 comments

Please show us your code, we can't help you with so little information.

<Container style={{paddingLeft: 10, paddingRight:10, flex: 1}}> <HTML html={this.state.data.htmlcontent} imagesMaxWidth={win}/> </Container>

this is my code , App get html content from API ,
content html include tag link <a href ... >downlad</a>
but url link download cant clicking...
thanks

Nothing wrong with that code, please copy/paste the HTML you're rendering.

You probably want to take a look at : onLinkPress
You can implement it such as : onLinkPress: (evt, href) => { Linking.openURL(href); }

@LouisJS Oh.. Thanks work it..

I asked myself the same question. Thanks.

So for others: Linking is not default, if there are <a...> in your HTML, you have to implement onLinkPress.

How does one "implement onLinkPress?

Answered my own question by looking at the demo here: https://goo.gl/ewkqXx

You probably want to take a look at : onLinkPress
You can implement it such as : onLinkPress: (evt, href) => { Linking.openURL(href); }

import {Linking } from 'react-native';

Implement link in react native render Html complete example

https://infinitbility.com/how-to-open-any-link-from-react-native-render-html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Anitorious picture Anitorious  路  7Comments

jamesawer3 picture jamesawer3  路  3Comments

Aparus picture Aparus  路  3Comments

sayem314 picture sayem314  路  6Comments

fahadhaq picture fahadhaq  路  6Comments