-
Notifications
You must be signed in to change notification settings - Fork 499
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
Invalid Hook Call, inside react-native-picker-select #486
Comments
Same issue :( No issue on iOS. |
Okay I found a workaround to fix it. I have re-install the module with this command => |
same problem here |
same problem on react-native 0.69.1 and react 18.0.0 |
I solved it with npm i --legacy-peer-deps And also making sure that the data I send on items is not undefined. |
FWIW, the issue seems to be with |
yes . npm i react-native-picker-select --legacy-peer-deps worked for me . Thanks @seb-glanum |
but it still crashes on the build android APK. WHY? |
Still crashes on Andoid APK for me too. |
Solved for me.
and used Yarn locally and in my CI/CD. I removed the usage of |
You only need to add <application android.supportsRtl == True /> in AndroidManifest.xml |
Same issue. Not working any proposed solution. |
For those who use solution with
|
Thanks so much! |
I found another solution which is adding this to the package json:
For npm this override the package dependency forcing it to use the same version set in the "main" dependencies. |
@stef1103 Thank a lot. Works perfect! |
@stef1103 Thank you! FWIW, I had to delete my |
@cavemon do i need to install react-native-picker/picker also? |
Yes. For clarity sake, here is a snippet of my "dependencies": {
"react-native-picker-select": "^8.0.4",
},
"overrides": {
"react-native-picker-select": {
"@react-native-picker/picker": "$@react-native-picker/picker"
}
} |
This is the way to go for now. |
Same issue here. |
Invalid Hook Call error inside react-native-picker-select node module.
Describe the bug
I get this issue everytime I build in android, it would show "Invalid Hook Call error" when it has to render the screen that uses RNPickerSelect (react-native-picker-select)
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
This error is located at:
in PickerAndroid (at Picker.js:174)
in Picker (at src/index.js:491)
in RCTView (at View.js:32)
in View (at src/index.js:489)
in RCTView (at View.js:32)
in View (at createAnimatedComponent.js:211)
in AnimatedComponent (at createAnimatedComponent.js:264)
in AnimatedComponentWrapper (at TouchableOpacity.js:224)
in TouchableOpacity (at TouchableOpacity.js:280)
in TouchableOpacity (at src/index.js:483)
in RNPickerSelect (at Picker.tsx:39)
in RCTView (at View.js:32)
in View (at Picker.tsx:38)
in RCTView (at View.js:32)
in View (at Picker.tsx:36)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It would render the picker and not crash the app
Screenshots
Additional details
Reproduction and/or code sample
<RNPickerSelect
placeholder={{label: 'test', value: 'test'}}
items={items}
onValueChange={props.functionOnChange}
style={styles}
useNativeAndroidPickerStyle={false}
/>
The text was updated successfully, but these errors were encountered: