question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onValueChange is not a function in android

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lfkwtzcommented, Sep 9, 2020

you’ll have to help me with a repro or some more details. i’m not clear what the problem is.

0reactions
lfkwtzcommented, Oct 11, 2020

please re-open a new bug report if that other issue is still present. sounds like the onValueChange was solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-dropdown-picker error - "onChange is not an ...
react-native-dropdown-picker error - "onChange is not an function (In onChange(value), onChange is undefined".
Read more >
Switch - React Native
Receives the change event as an argument. If you want to only receive the new value, use onValueChange instead. Type. function. onValueChange ......
Read more >
ContentObserver | Android Developers
If a Handler was supplied to the ContentObserver constructor, then a call to the onChange(boolean) method is posted to the handler's message queue....
Read more >
TextTrackList: change event - Web APIs - MDN Web Docs
The change event is fired when a text track is made active or inactive, or a TextTrackList is otherwise changed.
Read more >
react input onchange doesn't work - You.com | The AI Search ...
Ensure the child-components being rendered in the render method of your main component do not get unnecessarily re-rendered.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found