@expo/react-native-link
Advanced tools
Comparing version
39
link.js
@@ -7,36 +7,21 @@ /** | ||
*/ | ||
var React = require('react-native'); | ||
var { | ||
AppRegistry, | ||
Image, | ||
ScrollView, | ||
StyleSheet, | ||
Text, | ||
TouchableHighlight, | ||
View, | ||
} = React; | ||
import React from 'react'; | ||
import { TouchableHighlight, Linking } from 'react-native'; | ||
var URLHandler = require('react-native-url-handler'); | ||
var Link = React.createClass({ | ||
export default class Link extends React.Component { | ||
render() { | ||
return ( | ||
<TouchableHighlight onPress={this._linkPressed} {...this.props} /> | ||
); | ||
}, | ||
return <TouchableHighlight onPress={this._linkPressed} {...this.props} />; | ||
} | ||
_linkPressed() { | ||
_linkPressed = () => { | ||
if (this.props.url) { | ||
URLHandler.openURL(this.props.url); | ||
Linking.openURL(this.props.url); | ||
} else if (this.props.to && this.props.to.uri) { | ||
var url = this.props.to.uri; | ||
URLHandler.openURL(url); | ||
const url = this.props.to.uri; | ||
Linking.openURL(url); | ||
} else { | ||
console.error("Invalid Link destination:", this.props.to); | ||
console.error('Invalid Link destination:', this.props.to); | ||
} | ||
}, | ||
}); | ||
module.exports = Link; | ||
}; | ||
} |
{ | ||
"name": "@expo/react-native-link", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "A <Link> element for React Native, analogous to the <A> tag in HTML", | ||
@@ -22,6 +22,3 @@ "main": "link.js", | ||
}, | ||
"homepage": "https://github.com/expo/react-native-link#readme", | ||
"peerDependencies": { | ||
"react-native-url-handler": "*" | ||
} | ||
"homepage": "https://github.com/expo/react-native-link#readme" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
-100%2454
-22.73%4
-20%23
-34.29%1
Infinity%