React-id-swiper: Can I use component inside Swiper?

Created on 14 Jun 2018  路  1Comment  路  Source: kidjp85/react-id-swiper

I am trying to use Swiper to wrap a list of components with the coverflow effect but it doesn't work. It seems that the children of Swiper can only be <div>. Thanks for any help.

const params = {
effect: 'coverflow',
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true
},
pagination: {
el: '.swiper-pagination'
},
shouldSwiperUpdate: true,
rebuildOnUpdate: true
}

<Swiper {...params}><Item /><Item /><Item /></Swiper>

Most helpful comment

Hi @billyyyyy , you can wrap component inside Swiper.
In your case, you're using composite component (a component comprised of other components), so you need to provide props className within Item component for Swiper to add swiper-slide class name to each slide.
For more detail you can check a demo I made here.

>All comments

Hi @billyyyyy , you can wrap component inside Swiper.
In your case, you're using composite component (a component comprised of other components), so you need to provide props className within Item component for Swiper to add swiper-slide class name to each slide.
For more detail you can check a demo I made here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tylermwatts picture tylermwatts  路  5Comments

Alexandrdrdr picture Alexandrdrdr  路  3Comments

sergiokopplin picture sergiokopplin  路  4Comments

maheshambiga picture maheshambiga  路  4Comments

catamphetamine picture catamphetamine  路  5Comments