akiran/react-slick

Slider with only one slide item not displaying properly

andreivictor opened this issue · 2 comments

I have a slider with dynamic number of items.
At page load, the slider contains only one slide item.
The slider does not display properly.

const settings = {
    dots: true,
    slidesToShow: 1,
    slidesToScroll: 1
  };

React Slick version: 0.30.1

Stackblitz demo:
https://stackblitz.com/edit/vitejs-vite-zskgbz?file=src%2FImageSlider.jsx

try to set infinite: false

var settings = {
      dots: true,
      slidesToShow: 2,
      slidesToScroll: 1,
      infinite: false
};

Thank you, using infinite: false solved the issue.

const settings = {
    dots: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    infinite: false,
  };