onValueChange is not a function in android
See original GitHub issueDescribe the bug
I have xxxxx.android.js file
when I click an item from the selection list, getting
TypeError: onValueChange is not a function. (In ‘onValueChange(value, index)’, ‘onValueChange’ is undefined)
But I can see the select value in the input section. Previously I used like xxxxx.js file.m It also had an issue which is when selecting an item from the list, the selected item disappears right after a second any item was selected. But it’s gone after using xxxx.android.js.
To Reproduce
I am assuming it can’t be reproduced. Correct me if there is a way
<RNPickerSelect
onValueChange={(value) => console.log(value)}
items={getTypes(materials)}
useNativeAndroidPickerStyle={true}
value={trainingType}
placeholder={{
label: "Select training type",
value: null,
color: "grey",
}}
/>
Expected behavior
Able to get selected value on the callback
Screenshots
n/a
Additional details
Binaries:
Node: 10.19.0
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 23, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.2
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 1.8.0_265 - /usr/bin/javac
Python: 2.7.18 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
npmGlobalPackages:
react-native: Not Found
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
you’ll have to help me with a repro or some more details. i’m not clear what the problem is.
please re-open a new bug report if that other issue is still present. sounds like the onValueChange was solved.