joshswan / react-native-autolink

Automatic linking of URLs, phone numbers, emails, handles, and even custom patterns in text for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getReplacementArgs

nahcnats opened this issue · comments

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.

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.