Picker - undefined is not an object (evaluating 'this.props.children[position].props)
See original GitHub issueI am encountering a weird behaviour when using Picker.
I use a Picker as follows :
<Picker
mode="dropdown"
style={styles.pickerField}
selectedValue={this.state.dayAndTime}
onValueChange={(text) => this.setState({ dayAndTime: text })}
>
<Picker.Item label="Le 5/07 à 15H" value="0" key="0" />
</Picker>
When the screen displaying this picker is loaded, I got an error screen saying (cf. screenshot below) : undefined is not an object (evaluating 'this.props.children[position].props)
From what I gathered, my problem come from line 106 of Libraries/Components/Picker/PickerAndroid.android.js, it seems that onValueChange creates it, so I removed it, and I don’t have the error anymore.
I use react-native 0.31.0, I use an android api 23 virtual device with genymotion.
Is there something I am missing ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
react-native - Picker - undefined is not an object (evaluating ...
I had a similar issue but it was using an Item component + an array. ... <Picker style={styles.picker} mode="dropdown" { ...props }> <Picker...
Read more >react-native - Picker - undefined is not an object (evaluating ...
Coding example for the question react-native - Picker - undefined is not an object (evaluating 'this.props.children[position].props)-React Native.
Read more >ERROR TypeError: undefined is not an object (evaluating ...
Ever encountered this error → ERROR TypeError: undefined is not an object (evaluating '_this.props.navigation.navigate') whilst working hard on your project?
Read more >react-native - Picker - undefined is not an object ... - Reddit
react-native - Picker - undefined is not an object (evaluating 'this.props.children[position].props). r/reactnative - react-native - Picker ...
Read more >React Native. undefined is not an object (evaluating '_this ...
props.updateCellsBatchingPeriod'). Hi everybody, I have a react-native app created with RN CLI, using react-native 0.63, I'm ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
so, i found a resolution that we can create an array contains blank Item before use it.
Having the same issue as @alexsotocx, However if you add to static items, you can select them with no error, but any items dynamically added in a map throw the error reported