react-native-swiper icon indicating copy to clipboard operation
react-native-swiper copied to clipboard

Clicking on Next or Prev button i get error on Android

Open haykz7777 opened this issue 8 years ago • 3 comments

Which OS ?

Android

Version

Which versions are you using:

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

Expected behaviour

Navigate to the next page

Actual behaviour

Error undefined is not a function ( evaluating ;_this.scrollViewanimated > 'setPage':'setPageWithoutAnimation'')

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. set showsButtons={true}
  2. click on Next or Prev button
  3. you will see the error

haykz7777 avatar Apr 26 '18 22:04 haykz7777

Hi, have you found a solution to this problem?

ilariowiz avatar Sep 28 '18 08:09 ilariowiz

Any updates here?

sumitk avatar Oct 23 '18 22:10 sumitk

this worked for me on both ios/android:

_onMarkerPressed = e => {
    this.state.selectedId = e._targetInst.return.key

    const markerIndex = this.state.markers.findIndex(
      m => m.placeInfo.place_externalid === e._targetInst.return.key
    );

    this.previewPager.setPageWithoutAnimation(markerIndex);
  }

what did work on iOS but NOT on android:

_onMarkerPressed = function(e) {
    this.state.selectedId = e._targetInst.return.key

    const markerIndex = this.state.markers.findIndex(
      m => m.placeInfo.place_externalid === e._targetInst.return.key
    );

    this.previewPager.setPageWithoutAnimation(markerIndex);
  }.bind(this)

zaulin avatar Jan 05 '19 10:01 zaulin