raynor85 / react-native-material-selectize

A React Native component inspired to Selectize which follows Material Design guidelines.
MIT License
55 stars 32 forks source link

Slow data fetch and display #16

Closed chaosLegacy closed 5 years ago

chaosLegacy commented 6 years ago

Hi, I'm using this library for displaying a list of languages I have about 373 languages in a JSON file. the problem is that in my device (I'm using Samsung Galaxy s7) it takes too much to load about 5 to 6sec and if I select a language it will take around 6 to 7sec to display the chips every time. I was wondering if there is a way accelerate this process like limiting the data display for a certain a number and if the user decides to search a particular language only then it will fetch the data from the whole JSON.

Thank you

raynor85 commented 6 years ago

If you hard code your array of languages in a data structure and you pass it as a prop (without involving the network), do you still experience the delay? Nothing prevents you from transforming this data structure and passing it to the component in chunks.

chaosLegacy commented 6 years ago

Thanks for the quick feedback, actually I have my JSON file locally so there is no network delay to fetch the languages from the server, so yeah I thought about that and I hard-coded my array into a local file and I'm passing it as a prop, if I delete some languages I quickly get the results.

raynor85 commented 6 years ago

Uhm.. can you please write down a basic example to replicate the issue?

raynor85 commented 6 years ago

I think the problem is related to the inefficiency of the ScrollView. I will investigate and probably swap it with a FlatList, thank you for rising the issue.

raynor85 commented 5 years ago

It should be fixed with https://github.com/raynor85/react-native-material-selectize/pull/25/