React-native-swiper: undefined is not an object (evaluating '_this.state.offset[dir]')

Created on 9 Aug 2017  ·  10Comments  ·  Source: leecade/react-native-swiper

react-native-cli: 2.0.1
react-native: 0.46.3
"react-native-swiper": "^1.5.7",
"react-native-photo-view": "^1.3.0",

I copy the the code of demo: PhotoView

when swipe to the edge, it goes wrong, what's the problem ?

2017-08-10 12 02 30

All 10 comments

+1
Basically when you reach the end of the loop it crashes with that error

I can also confirm this is working fine in version 1.5.5 and not working with 1.5.7 and 1.5.8

https://github.com/leecade/react-native-swiper/compare/1.5.5...1.5.7

Seems related to this
https://github.com/leecade/react-native-swiper/blob/4336cf934250cfe98659eea70acfc1822e9b448b/src/index.js#L230-L251

@arribbar Can you dig into this?
I tried the examples in my laptop on IOS emulator and all the examples work fine. Even if I swipe from the edges.

+1,1.5.7 has this problem,too.

I update to version 1.5.8, and it works fine, cheers!

WTF! I did nothing but it's ok now~~

It's not crashing but it doesn't work properly.
giphy 1

Example of a swiper with infinite loop, 3 images and 3 dots:
When you do a swipe on the left to move to the second image, the dot is not changing.
When you swipe again on the left to move to the third image, the dot is changing to position 2.
When you swipe again you are at the initial image but the dot is on position 3 instead of 1.

I revert back to 1.5.5 😢

Thanks,i've got it. On 2017-08-11 18:53 , Mattia Asti Wrote: It's not crashing but it doesn't work properly. Example of a swiper with infinite loop, 3 images and 3 dots: When you do a swipe on the left to move to the second image, the dot is not changing. When you swipe again on the left to move to the third image, the dot is changing to position 2. When you swipe again you are at the initial image but the dot is on position 3 instead of 1. It's not crashing but doesn't work properly. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

@mtt87 Can you create a new issue please with your bug?
Can you add some infos as OS platform, RN version, RN Swiper version. If you could add an example of your code in which we can reproduce the bug, it would be great. You can fork the project and change one example to do so.
Thanks !

I'm having the same runtime error on 1.5.12. Did we come to a solution?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diegolmello picture diegolmello  ·  3Comments

tibic picture tibic  ·  3Comments

ruben-kasaz picture ruben-kasaz  ·  3Comments

tokict picture tokict  ·  3Comments

AndriiBoiko picture AndriiBoiko  ·  3Comments