react-native-segmented-picker
react-native-segmented-picker copied to clipboard
render error
<ScrollView style={styles.container}>
...
<SegmentedPicker
ref={this.segmentedPicker}
onConfirm={(selections) => alert(JSON.stringify(selections))}
options={[
{
key: 'col_1',
items: [
{ label: 'Option 1', value: 'option_1' },
{ label: 'Option 2', value: 'option_2' },
],
},
{
key: 'col_2',
items: [
{ label: 'Option 3', value: 'option_3' },
],
},
]}
/>
</ScrollView>
Thanks for the report @ebtone.
Seems like the class isn't initialising properly which is pretty strange, but I'm also wondering if that's just a symptom rather than a cause.
What React Native version are you using?
hi @adammcarth 0.60.5 same issue
Damn... This is a real head scratcher! I'll try and replicate it locally tonight. The strange thing is that if you go into node_modules/react-native-segmented-picker/dist/bundle.js
, I see the suspect function called SegmentedPicker.ApplyPickerOptionDefaults
defined inside the file on line 1202
.
@cenaHara What version of this library are you using (2.0.2
?) and also, are you using Expo or just a vanilla React Native application?
At what point do you see the error... when your screen or component mounts, or explicitly when you try and show/hide the picker?
hi @adammcarth yes my version is 2.0.2 and use react native cli ( not Expo ) error when init screen
hi @adammcarth this is my version info and use react native cli ( not Expo ) { "dependencies": { "react": "16.8.3", "react-native": "0.59.10", "react-native-segmented-picker": "~2.0.2" } }