Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant Violation: View config getter callback for component BVLinearGradient must be a function (received undefined). #538

Open
pankajvaghelav2 opened this issue Aug 20, 2021 · 5 comments

Comments

@pankajvaghelav2
Copy link

pankajvaghelav2 commented Aug 20, 2021

I am trying to setup this lib for iOS

I am getting this error log in metro console

Invariant Violation: View config getter callback for component BVLinearGradient must be a function (received undefined)

This error is located at:
    in BVLinearGradient (at react-native-linear-gradient/index.ios.js:54)
    in LinearGradient (at WelcomeView.react.tsx:90) 

i have tried bunch of stuff like

  • pod install
  • npx pod-install
  • react-native link react-native-linear-gradient
  • clear watchman cache, clear pod cache

this issue still persist, i think library is not able to identify nativeModule,

anything else i could do other than above mentioned stuff?
thanks.

@evaei
Copy link

evaei commented Aug 24, 2021

Please try to change on BVLinearGradient.podspec in the module folder

change
s.dependency 'React'
to
s.dependency 'React-Core'

and pod deintegrate and pod install again

It working for me,

I don't know why they didn't release the latest version yet.

@pankajvaghelav2
Copy link
Author

Thanks @evaei
tried doing that but that didnt work for me. still getting same error

@brunomartinezciompi
Copy link

same error here

@brunobrante
Copy link

Same Error on Android

@thisisharrison
Copy link

I also encountered this when upgrading from RN 0.63.1 to 0.65.1.

Try running npm list react-native to see which version of React Native react-native-linear-gradient is using. You may find that there are different versions of react-native in your project and react-native-linear-gradient is using an older version of RN.

├─┬ react-native-linear-gradient@2.5.6
│ └── react-native@0.65.1 deduped // your line might be different here

To resolve this, add resolutions to package.json. Then remove node_modules and run yarn/npm install.

"resolutions": {
        "react-native": "0.65.1",
    },

This fixed it for me. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants