akiran / react-slick

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

"slide" Setting Doesn't Work #2148

Open simon-online opened 2 years ago

simon-online commented 2 years ago

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

TharinduK97 commented 2 years ago

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 (

{ array.map((m,index)=>{ return(
{m}
) }) }

); }

export default App;`

gtb104 commented 2 years ago

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?

eins78 commented 2 years ago

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)