leecade / leecade/react-native-swiper

loadMinimal It does not work well

Open
#547 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Which OS ?
Version

Which versions are you using:

  • react-native-swiper v1.5.10
  • react-native v0.46.4
Expected behaviour

When moving to a new view the previous views would have to be removed. Especially if it contains images.

Actual behaviour

Currently it seems to work but I am using 100 images and when I get to image 40 approximately the application crash.

I'm sure you're making lots of memory use. But in the life cycles of react componentWillUnmount () are called upon leaving the view.

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.

Steps to reproduce
  1. Create a list requiring 100 local pictures
  2. Create a component to represent each image in full screen
  3. Config Swiper
let allItems =  this.props.allData.map((item, index) => {
      return ( <FullScreen key={item.key} photoId={index}/> );
 });

<Swiper 
     index={(this.props.index) ? this.props.index : 0}
     style={styles.wrapper} 
     showsButtons={false} 
     loadMinimal={true} 
     loadMinimalSize={1} 
     showsPagination={false} 
     autoplay={false}
     loop={false}
     removeClippedSubviews={true}
     onIndexChanged={(index) => this._onIndexChange(index)}
>
   {allItems}
</Swiper>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the loadMinimal and loadMinimalSize handling in the component and the related example under examples/. Reproduce the issue with 100 local full-screen images and the configuration shown, then inspect whether previous views are removed as navigation advances. Done means the example can advance through the image list without the application crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.