React IonSlide right left navigation not woriking

367 views Asked by At

Hi I am using ionic react. I tried ionslide and its working fine with the slide /swap. But I can't manage to show slider right left navigation. And my pagination dot works fine. I cant even find a way to use custom slide next prev button.

How to use slideNext from the documentation.

https://ionicframework.com/docs/api/slides#methods

1

There are 1 answers

0
Shuhad zaman On

Finally I managed to get a way around. here is the solution if anyone interested. first get an instance and set a state.

  const [swiper, setSwiper] = useState<any>({});
  const init = async function(this: any) {
    setSwiper(await this.getSwiper());
};
<IonSlides options={slideOpts} mode="ios"  onIonSlidesDidLoad={init}  >

after that on my next button handler

  const handleSlidesControlNext = () =>{
      swiper.slideNext(300)
  }