react-native-hyperlink icon indicating copy to clipboard operation
react-native-hyperlink copied to clipboard

Throwing error with react-native 0.69.3

Open ursnj opened this issue 2 years ago • 1 comments

Describe the bug

Warning: Failed prop type: Hyperlink: prop type linkStyle is invalid; it must be a function, usually from the prop-types package, but received undefined.This often happens because of typos such as PropTypes.function instead of PropTypes.func. at Hyperlink (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=njsolutions.watchpartys&modulesOnly=false&runModule=true:216800:22)

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

ursnj avatar Jul 29 '22 13:07 ursnj

I'm experiencing exactly the same error, now running on Expo SDK 46 ([email protected])

adamblvck avatar Aug 11 '22 20:08 adamblvck

when will a release be made with the fix? looks like the PR is already done

karanmartian avatar Aug 15 '22 09:08 karanmartian

I dont think this is active , so i ahve fixed it in react-native-linkify library

ursnj avatar Aug 15 '22 11:08 ursnj

@ursnj could you share the link to this library? cant find it - react-native-linkify

karanmartian avatar Aug 15 '22 12:08 karanmartian

https://www.npmjs.com/package/react-native-linkify

ursnj avatar Aug 15 '22 16:08 ursnj

@ursnj you are still using const textPropTypes = Text.propTypes || {} in that source at the new repo if I am not mistaken. This would throw the same error. It should be TextPropTypes right?

karanmartian avatar Aug 16 '22 08:08 karanmartian

@karanmartian did you try @ursnj's package? Solved the issue for me 👌. It would prefer a fix to this repo here, but if it is not active what can we do?

tomwaitforitmy avatar Aug 21 '22 13:08 tomwaitforitmy

hey folks, fixed in 0.0.21. Let me know if this works.

obipawan avatar Aug 22 '22 08:08 obipawan

@obipawan this new release is giving typescript issues.

import Hyperlink JSX element type 'Hyperlink' does not have any construct or call signatures.

sandergo90 avatar Aug 22 '22 10:08 sandergo90

Oh crap i messed up the export! I'll fix this in an hour, I'm outside without my machine. In the meanwhile you can import {Hyperlink} from 'react-native-hyperlink'.

obipawan avatar Aug 22 '22 10:08 obipawan

@sandergo90 updated with v0.0.22. Hope this works 🤞

obipawan avatar Aug 22 '22 15:08 obipawan

Works like a charm, thanks 👌

sandergo90 avatar Aug 23 '22 10:08 sandergo90