akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.61k stars 2.09k forks source link

slick-slide calculating width not correct #2293

Closed TranManhThang96 closed 5 months ago

TranManhThang96 commented 8 months ago

When I use antd design's carousel based on the react-slick library, the front and back slides of the active slides appear. Is there any way to fix this error?

This is my code

<div className="interview-wrapper">
  <Carousel
    className="carousel"
    ref={carouselRef}
    speed={500}
    slidesToShow={3}
    dots={false}
    centerMode={true}
    infinite={true}
  >
    {MainViewSliderMock.map((slide, index) => (
      <div className="carousel-item" key={index}>
        <Card hoverable cover={<img alt="example" src={slide.image} />}>
          <h3 className="title">{slide.title}</h3>
          <p className="description">{slide.subtitle}</p>
        </Card>
      </div>
    ))}
  </Carousel>
</div>;

error

akiran commented 5 months ago

set centerMode={false} if you don't want to see partial slides at the edges.