Home > Software engineering >  React native picker long list handler
React native picker long list handler

Time:03-04

I have a long list of company names need to be displayed in the picker dropdown and it's causing the app to freeze. I am aware of the infinite scroll if it's viewing the content, where you fetch a limited size of the data from the server side and load more as the scroll reach to the bottom. But does it apply the same concept for a dropdown picker?

I am using the library @react-native-picker/picker and considering the behavior of the component I have no idea how to handle it.

I haven't done anything on my codes yet. Currently it's fetching all the listing from the server side and dump all the data in the picker.

CodePudding user response:

usually it's best practice for large select list to create a modal screen which open up by clicking on the selectbox and there you provide a search box on top and show list using FlatList as it's good for large set of data and will not freeze your screen while rendering.

Check out this

CodePudding user response:

This issue 2850 mentioned something may help you and to be clear there was a solution mentioned by M1K3Yio
please check the code using react-window in this link !!

  • Related