-
Notifications
You must be signed in to change notification settings - Fork 462
onLinkPress #9
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
Comments
Are you just trying to get the link to open in the browser? You can just do this: var React = require('react-native')
var {
Linking,
} = React
//...
render() {
return <HTMLView
value={htmlContent}
onLinkPress={Linking.openURL}
/>
} |
Hi, var LeftMenuBack = require('./Widgets/LeftMenuBack'); var HTMLView = require('react-native-htmlview'); var { BackAndroid.addEventListener('hardwareBackPress', function() { var Inbox = React.createClass({
<Text style={{color: 'yellow'}}
}); module.exports = Inbox; var styles = StyleSheet.create({ |
You seem to have put the handler which calls Linking.openURL in a prop called 'onPress' but it needs to be passed in as the 'onLinkPress' (which you're currently passing a handler which calls console.log) |
Hi James,
|
The code in your last example should be <HTMLView
value={htmlContent}
onLinkPress={() => Linking.openURL('http://google.com') }
stylesheet={styles}
/> |
Hi, John |
This seems likely to have been an issue unrelated to this package. It's been over a year: if you're still having problems, please open a new issue and we'll try to get to the bottom of it! |
Hi,
While the htmlContent displays correctly I can't seem to get onLinkPress to work
Thanks,
John
The text was updated successfully, but these errors were encountered: