leecade / leecade/react-native-swiper

Update the state breaks the slides.

Open
#1,053 35 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Which OS ?

MAC OS

Version

Which versions are you using:
^1.6.0-nightly.3

  • react-native-swiper v?
  • react-native v0.59.5

Hello Guys,
I am using Swiper like this:

renderThumb() {
        return (
            <Swiper style={styles.wrapper} showsButtons={false} horizontal={false} showsPagination={false} loop={false} onIndexChanged={this.onSlideIndexUpdate} onMomentumScrollEnd={() => { console.log('on touch end') }}>
                {this.state.cachedThumbnails.map((thumb) => {
                    console.log('HERE THUMB', thumb)
                    return (
                        <View key={thumb.key} style={styles.thumbnailContainer}>
                            <Loader loading={this.state.showThumbnail} withBackground={false} showLoadingText={false} />
                            <Image
                                source={{ uri: thumb.thumbLink }}
                                style={styles.backgroundVideo}
                                resizeMode='cover'
                            />
                  
                        </View>
                    );
                })}
            </Swiper>
        );
    };

Every time when the state is changed, the component is re-rendered, but the slide is pushed up and the next slide is seeing from the bottom, as showed here in the image:

Please note, this happens only on the images with index>0. If I swipe to the first slide, the slide is ok.

Screen Shot 2019-09-05 at 16 39 46

Screen Shot 2019-09-05 at 16 39 55

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

The issue names no repository files or tests; start by reproducing the provided renderThumb example on React Native 0.59.5 while changing state. Trace the swiper behavior for slides after index 0, and consider the issue done when state updates no longer shift the current slide or reveal the next slide from below.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.