joshswan / react-native-autolink

Automatic linking of URLs, phone numbers, emails, handles, and even custom patterns in text for React Native
MIT License
656 stars 82 forks source link

getReplacementArgs #68

Closed nahcnats closed 1 year ago

nahcnats commented 1 year ago

if my text is "the cow jump over [test](www.google.com) and found gold". When I use the following:

onPress: (match) => { console.log(match.getReplacerArgs()[2]) }

It returns something like @__Element etc. Why? Where did I do wrong? Appreciate your assistance.

joshswan commented 1 year ago

My suggestion would be to avoid using getReplacerArgs directly and instead use match.matchedText, match.getAnchorText(), match.getType(), etc. depending on what you're trying to accomplish.