React-native-swiper: ScrollBy method undefined

Created on 2 Jan 2020  路  3Comments  路  Source: leecade/react-native-swiper

Hello! I am trying to use react-native-swiper on my project.
I had my own custom buttons. So when I click on a button, it calls the scrollBy function.
But it's not working.

This is what I coded :

Capture d鈥檈虂cran 2020-01-02 a虁 17 19 03

This is the error I get :

80896317_2650806868288379_6172734462464360448_n

How I can solve this ?
Thanks.

Which OS ?

Android

Version

Which versions are you using:

  • react-native-swiper v1.5.14
  • react-native v0.59

Most helpful comment

ref.current.scrollBy

All 3 comments

ref.current.scrollBy

try using this.refs.swiper.scrollBy(n) in your case refs.swiper.scrollBy(n)

ref.current.scrollBy

This works, the issue can be closed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

Liqiankun picture Liqiankun  路  3Comments

AndrewSouthpaw picture AndrewSouthpaw  路  3Comments

diegolmello picture diegolmello  路  3Comments

chetanparakh picture chetanparakh  路  3Comments