obipawan / react-native-hyperlink

A <Hyperlink /> component for react-native that makes urls, fuzzy links, emails etc clickable
MIT License
801 stars 76 forks source link

`linkify` prop is no longer optional #44

Closed stianjensen closed 4 years ago

stianjensen commented 4 years ago

As of 0.17.0 that was released today, the library does no longer work when you do not provide a custom linkify-it object as a prop.

The problem is that the existing default value that gets set in the constructor gets unset by the getDerivedStateFromProps call here: https://github.com/obipawan/react-native-hyperlink/blob/980b4117928bad092a8eb816c6b09ac8ef43771d/src/Hyperlink.js#L20

A work-around for now is to always pass in the same default value from the outside.

obipawan commented 4 years ago

hi @stianjensen Thanks for reporting! This is an unfortunate miss from my end. I've made a release with linkify declared with a default prop. Should be ok as the instance is shared for renders without this prop. v0.0.18. Let me know if there are any other issues 👍