React-native-swiper: Swiper cuts off after state update on another page

Created on 24 Aug 2020  路  13Comments  路  Source: leecade/react-native-swiper

Screen Shot 2020-08-24 at 11 24 13 AM

After I swipe to the second page, if a state update occurs on the previous page, the current page gets drifted to the left. Is there any solution to this issue?

Most helpful comment

Sure! In my package.json I changed:
"react-native-swiper": "^1.6.0",
to
"react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

All 13 comments

the same problem - if I like the page and state updates, the screen changes the page on another one, but pagination stays the same. Then I swipe and see on the same pagination necessary liked screen. So once again, pagination stays the same. And then if there no more state updates, the swiper works as usual.
That's just on ios, android works properly.

Is there any solution to this issue?

I just ran into this issue too and fixed it by using the current master ref in my package.json. Looks like this is fixed in master!

Can you expand on changing the ref to master? Sorry i'm quiet new to this

Sure! In my package.json I changed:
"react-native-swiper": "^1.6.0",
to
"react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

Sure! In my package.json I changed:
"react-native-swiper": "^1.6.0",
to
"react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

still doesn't work

Hi Guys,
I have encounter the same issue.
Any updates ?

same issue #1171

1174 Please try this. Actually it's already fixed, but missed in the 1.6.0 release.

@

same issue #1171

1174 Please try this. Actually it's already fixed, but missed in the 1.6.0 release.

@kchangch

when is this thing going to get updated ??

@skv-headless @mohity7777
Look at the comment.

  renderScrollView = pages => {
    return (
      <ScrollView
        ref={this.refScrollView}
        {...this.props}
        {...this.scrollViewPropOverrides()}
        contentContainerStyle={[styles.wrapperIOS, this.props.style]}
        // try remove this line. or sync the state.offset with internal.offset.
        // contentOffset={this.state.offset}
        onScrollBeginDrag={this.onScrollBegin}
        onMomentumScrollEnd={this.onScrollEnd}
        onScrollEndDrag={this.onScrollEndDrag}
        style={this.props.scrollViewStyle}
      >
        {pages}
      </ScrollView>
    )
  }

Actually doing the changes in node modules solved my issue. I just meant that why is this not there in latest release ?

Sure! In my package.json I changed:
"react-native-swiper": "^1.6.0",
to
"react-native-swiper": "https://github.com/leecade/react-native-swiper#5827a80002738abd1c0dc08428303c79bbc840c0",

This solved it for me. Thank you!
They should really publish this as an 1.6.1, since this seems to be a common issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liqiankun picture Liqiankun  路  3Comments

AndrewSouthpaw picture AndrewSouthpaw  路  3Comments

chetanparakh picture chetanparakh  路  3Comments

diegolmello picture diegolmello  路  3Comments

kliuj picture kliuj  路  3Comments