joshswan/react-native-autolink

onpress does not take effect

Qy742698 opened this issue · 1 comments

I'm using the onpress method, which, judging by the mention property, won't display the Alert.alert ('Mention pressed!') ;

<Autolink
text={text}
onPress={(url, match) => {
switch (match.getType()) {
case 'mention':
Alert.alert('Mention pressed!');
default:
Alert.alert('Link pressed!');
}
}}
/>

You are missing both a break in your switch AND props to control mentions and other types of links (i.e. the mention, url, etc. props).

Please stop opening issues without clear reproductions that have to do with this library and not your code. This is not a support forum.

Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-07-21.at.23.54.04.mp4