react-slick
react-slick copied to clipboard
Last item is shown
Why the last item is shown. I set it to centerMode: true
const App = () => {
const settings = {
dots: true,
cssEase: 'linear',
infinite: true,
speed: 500,
slidesToShow: 2,
slidesToScroll: 2,
centerMode: true,
};
return (
<Fragment>
<div className="text-center">
<h2> Single Item</h2>
<Slider {...settings}>
<div>
<h3>1</h3>
</div>
<div>
<h3>2</h3>
</div>
<div>
<h3>3</h3>
</div>
<div>
<h3>4</h3>
</div>
</Slider>
</div>
</Fragment>
);
};
You have to set the initialSlide
prop which indicates the index of the slide to start at.
initialSlide
didn't work for me personally, but setting infinite: false
worked
Does anyone solve it
infinite: false
yes it works, but I also need initialSlide=0 and infinite=true
I also need to use infinite=true and initialSlide=0, when i do use this config last slide is shown first
This still seems to be an issue, is there any thoughts on a resolution for this please?