picker icon indicating copy to clipboard operation
picker copied to clipboard

Picker becomes slow when the number of Picker.Items are more than 500

Open bmitioglov opened this issue 1 year ago • 0 comments

"@react-native-picker/picker": "^2.4.8", "react-native": "0.68.6",

I use it like this:

<Picker
  style={{fontSize: 23, width: 100, alignSelf: 'center', marginHorizontal: -5}}
  selectedValue={item.weightLb.toString()}
  onValueChange={(itemValue, itemIndex) =>
    updateSetWeight(item.id, itemValue, itemValue) //FIXME: make lb or kg
  }>
  {[...Array(1000).keys()].map(number => {
    return <Picker.Item key={number} label={number.toString()} value={number.toString()} />
  })}
</Picker>

Picker becomes slow when the number of Picker.Items are more than 500. Is there a way to make it faster? Maybe some optimization technique? Please help

bmitioglov avatar Aug 16 '23 04:08 bmitioglov