-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
I'm trying to open a link from the React Native app.
For this, I'm using Linking from react-native package.
The problem is that only sometimes opens the link. In other cases it does nothing.
I also change the <Text> component with a <TouchableOpacity> but its still the same issue.
The problem is not from the if check, because the url its always valid ( and to falsy )
Anyone else had the same issue, any ideas to fix this issue?
Code Sample
handlerOpenLink = url => {
if (url) {
Linking.openURL(url);
} else {
Alert.alert( "some message" );
}
};
return
<View>
<Text
onPress={ () => this.handlerOpenLink(url)}
>
Open Link
</Text>
</View>