Automatic linking of URLs, phone numbers, emails, handles, and even custom patterns in text for React Native
Big update and huge thanks to @lafiosca for the awesome PR with custom matcher support. There are a few breaking changes that were in the works already for v4 (see below), but migration should be fairly simple. And once you're updated, the new matchers
prop with custom regexes, onPress handers, styling and more is a game-changer!
email
, hashtag
, etc. props to
enable.truncate={32}
to enable previous behaviorlatlng
removed - import LatLngMatcher
and supply to matchers prop insteaduseNativeSchemes
to link directly to apps instead or use
onPress
/onLongPress
/matchers
to customize behavior.Customization of the container component is now supported via the component
prop. By default, the container is still a Text
component, but you can override with a View
or a custom component for more flexibility.
Additionally, the new linkProps
, textProps
, and renderText
provide allow you to completely customize Autolink's behavior to your specific needs.
linkStyle
and props supplied to linkProps
are used when rendering links. You are still free to
use renderLink
to fully customize link rendering. This is unlikely to cause issues for anyone, but could affect some apps visually, hence the major version bump.🎉 The library has been rewritten in TypeScript to make development easier and to keep the much-requested typings in sync automatically. Also, the test have been simplified using Jest snapshots, which also gives you an opportunity to see the effects of various configuration prop settings.
twitter
prop no longer supported - please use the mention
propBug Fixes:
Bug Fixes:
New Stuff: