react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

"slide" Setting Doesn't Work

Open simon-online opened this issue 2 years ago • 2 comments

It seems like the "slide" setting doesn't work. In the documentation it says:

slide Type: string Default: 'div' Description: Slide container type

However when I try to change the slide container type to a section element instead it remains a div. Also I notice that when I set the react key prop on each slide it doesn't work. The key prop seems to be getting set to something different to what I set.

Here is my example that is attempting to change the slide container type to a section element. https://codesandbox.io/s/react-slick-playground-forked-jylzjv

simon-online avatar Apr 11 '22 05:04 simon-online

It is not much clear about the issue. But we can use slide attributes with other relevant attributes. And it is good to post what kind of Carousel component you tried to use?? I have posted some code below. I think you can get an idea from it. `function App() { const [array, serArray]=useState([1,2,3,4])

var settings = { dots: true, infinite: true, speed: 500, slide: "section", slidesToShow: 1, slidesToScroll: 1 };

return ( <div className="App"> <Slider {...settings}> {

      array.map((m,index)=>{
        return(
        <section key={index}>
          {m}
        </section>
        )
      })
    }
   
  </Slider>
</div>

); }

export default App;`

TharinduK97 avatar May 18 '22 19:05 TharinduK97

I also believe that the slide property is not used. I've looked through the code and do not see where it's used. Could you point out where it's used?

gtb104 avatar Jun 15 '22 14:06 gtb104

there is no slide prop. there is swipe for turning swiping behaviour on or off and a prop initialSlide to define the starting slide (note its "initial" because its not a controlled prop - the Slider keeps its own state)

eins78 avatar Oct 14 '22 08:10 eins78