adammcarth / react-native-segmented-picker

Selection picker wheel with multi-column support and optional native dependencies.
MIT License
96 stars 31 forks source link

render error #32

Open ebtone opened 3 years ago

ebtone commented 3 years ago
<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>

2831603249103_ pic

adammcarth commented 3 years ago

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?

cenaHara commented 3 years ago

hi @adammcarth 0.60.5 same issue

adammcarth commented 3 years ago

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?

cenaHara commented 3 years ago

hi @adammcarth yes my version is 2.0.2 and use react native cli ( not Expo ) error when init screen

ebtone commented 3 years ago

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" } }