joshswan / react-native-autolink

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

render() for CustomMatchers #73

Closed muonsei closed 11 months ago

muonsei commented 11 months ago

Is there a way to use a custom component with a CustomMatcher, something like renderLink() as seen here? I'm looking into using something like MotiPressable or MotiLink on a CustomMatcher since I need something that cannot be handled by just onPress() to control each matcher's behavior.

joshswan commented 11 months ago

Wasn't possible before but just added it in v4.2.0 as it seems like a super useful option.

CustomMatch objects now take an optional renderLink function (same signature as the main one) that can be used to override the rendering of just that one custom match.