0

I m using React. I am trying to implement a carousel and I tried to trigger auto play option(props for Slider literally) in react-slick, the autoplay in react-slick is not working.

  • https://codesandbox.io/s/2v7j4ml670 - here is an example implement Help Me out!!!!!! – Hari Heartcore May 30 '18 at 16:08
  • 4
    It is difficult to offer solutions when the problem statement is simply, ["it doesn't work"](http://idownvotedbecau.se/itsnotworking/). Please [edit] your question to give a more complete description of what you expected to happen and how that differs from the actual results. See [ask] for hints on what makes a good explanation. – Toby Speight May 30 '18 at 16:48

2 Answers2

0

I had used react-slick 0.23.1 which it doesn't work

Later I tried with react-slick 0.21.0 it did work

Thanks!

0

Give a reference to the tag.

<Slider ref={slider => (this.slider = slider)}>
 ...
</Slider>

You can use the slickPause() & slickPlay() functions

play() {
  this.slider.slickPlay();
}

pause() {
  this.slider.slickPause();
}

https://github.com/akiran/react-slick/blob/master/examples/AutoPlayMethods.js