When used on Web, error about prop types appear.
Describe the bug
This error is given on Web:
Failed prop type: Hyperlink: prop type linkStyle is invalid; it must be a function, usually from the prop-types package, but received undefined. in Hyperlink (created by _default)
This happens because Text.propTypes is no longer a thing in latest RNW.
To Reproduce Try using this package with latest RNW.
Expected behavior No error should be logged
Additional info
I patched this in my own project by simply doing this:
linkStyle: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].number]),
I can confirm this patch works, but creates a new warning if you happen to use react-native-hyperlink on both web and native in the same project. I would suggest you remove the PropType for linkStyle altogether as a workaround.
- Edit
node_modules/react-native-hyperlink/src/Hyperlink.js - Remove the line with
linkStyle: textPropTypes.style, - Make your patch persistent somehow, e.g.
npx patch-package react-native-hyperlink
the latest version v0.0.22 has the fix with types.
Hi @obipawan do you know when v0.0.22 will be released?