Skip to content

Instantly share code, notes, and snippets.

@aloukissas
Created January 31, 2019 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aloukissas/2514dd037ad2daa11155b734e6f08fde to your computer and use it in GitHub Desktop.
Save aloukissas/2514dd037ad2daa11155b734e6f08fde to your computer and use it in GitHub Desktop.
import React from "react";
import { Linking, Text, View } from "react-native";
class LinkingDemo extends React.Component {
handleOpenUrl = url => {
Linking.openURL(url);
}
render() {
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center"
}}
>
<Text onPress={() => this.handleOpenUrl("https://chck.app")}>
Go to website
</Text>
</View>
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment