manyuanrong / manyuanrong/react-native-masonry-layout
Not loading bulk data (say 2000) at one go
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 89
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Thanks a lot for this amazing library. It's easy to implement and use.
But I've some time latency issues to load bulk data at one go.
So what I'm doing exactly is:
I've around 2000 data in an array and for each item there is tappable view (TouchableHighlight , like pinterest) so that user can tap any item to see corresponding detail view. see my code below for your reference:
`<TouchableHighlight style = {styles.ingredientItem} key = {item.identifier.toString()} onPress = {() => this.didSelectIngredientCell(item)} underlayColor = 'transparent'>
<View style = {styles.ingredientCellView}>
<FastImage style = {styles.ingredientImage}
source = {{
uri: JSON.stringify(item.imageURLString),
headers: { 'atipik-custom-key': Constants.atipikCustomKey },
cache: FastImage.cacheControl.cacheOnly }}
resizeMode = {FastImage.resizeMode.cover}/>
<Text style = {styles.ingredientNameText}>{item.name.toUpperCase()}</Text>
<Text style = {styles.ingredientRestDetailsText}>{item.upn}</Text>
{(item.typeName != null && item.typeName != '') && <Text style = {styles.ingredientRestDetailsText}>{item.typeName}</Text>}
{(item.primaryFamily != null && item.primaryFamily.name != '') &&
<View style = {styles.bgViewForObjects}>
<View style = {{width: 14, height: 14, borderRadius: 7, backgroundColor: item.primaryFamily.colorString}} />
<Text style = {styles.ingredientRestDetailsText}>{item.primaryFamily.name.toUpperCase()}</Text>
</View>}
{(item.secondaryFamily != null && item.secondaryFamily.name != '') &&
<View style = {[styles.bgViewForObjects, {paddingTop: 3}]}>
<View style = {{width: 14, height: 14, borderRadius: 7, backgroundColor: item.secondaryFamily.colorString}} />
<Text style = {styles.ingredientRestDetailsText}>{item.secondaryFamily.name.toUpperCase()}</Text>
</View>}
<Text style = {{paddingBottom: 0}}></Text>
</View>
</TouchableHighlight>
`
Now, when i load these 2000 data then it's not loading at one go. Initially it's loading 50-70 data views and then as I scroll, further views are loading but with very normal speed which means it'll take sufficient amount to load all 2000 data which is not acceptable.
Could you please assist me how do i load all 2000 data instantaneously?
thanks & regards
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named. Start by reproducing the behavior with the provided TouchableHighlight and FastImage item view and inspect how the masonry component renders the initial 50–70 items and loads more during scrolling. Done should be defined as an acceptable, measured behavior for displaying about 2,000 items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- frontend, mobile, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100