Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onLinkPress needs to be clearly documented. #188

Closed
magicmiles opened this issue Oct 2, 2018 · 11 comments
Closed

onLinkPress needs to be clearly documented. #188

magicmiles opened this issue Oct 2, 2018 · 11 comments
Labels
documentation is:FAQ candidate A canonical issue to put in the FAQ. meta

Comments

@magicmiles
Copy link

Can I make a suggestion:

On your docs Page there should be a section about onLinkPress that reads something like |

To enable the user to press a link, the LINKING library must be IMPORTED at the top of your code, as well as this line must appear in the HTML call statement like so:

        <HTML
          html={this.content}
          onLinkPress={(event, href)=>{
            Linking.openURL(href)
          }}
        />
@erhanbicer
Copy link

@magicmiles thank you.

@davidcort
Copy link

I have troubles with this ...
Seems not works with the app is make with Expo :(

@abzeede
Copy link

abzeede commented Feb 16, 2019

@davidcort It's doing fine with expo but you must import Linking from expo not react-native
Example: import { Linking } from 'expo'

@intransitorio
Copy link

this post saved my morning. Thanks @magicmiles

@code-jenn-or
Copy link

Saved my bacon by providing this, THANK YOU!!! Worked awesome for phone linking too by providing the tel: in the href before the number.

@Synaric
Copy link

Synaric commented Oct 31, 2019

Thanks for your example! Really help me.

@guille-alibrate
Copy link

guille-alibrate commented Jan 16, 2020

Excelent.
One question: how could you get the link text, besides the href attribute? The text is valuable info too.

<a href="...">This here</a>

@Yab-kami
Copy link

Excelent.
One question: how could you get the link text, besides the href attribute? The text is valuable info too.

<a href="...">This here</a>

Any Update on this?

@jsamr jsamr added is:FAQ candidate A canonical issue to put in the FAQ. meta labels Jul 5, 2020
@Akira-25
Copy link

You're a legend @davidcort

@Fred-Reis
Copy link

If you import Linking from react-native, it's work like a charm.

@jsamr
Copy link
Collaborator

jsamr commented Dec 5, 2020

In react-native-render-html v5.0.0, onLinkPress defaults to a function invoking Linking.openURL, so there won't be a need for documenting this! See #442

@jsamr jsamr closed this as completed Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation is:FAQ candidate A canonical issue to put in the FAQ. meta
Projects
None yet
Development

No branches or pull requests