Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bmitioglov opened this issue Aug 16, 2023 · 0 comments
Open

Comments

@bmitioglov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant