Hello,
I am trying to use the swiper by populating it with a variable number of components based on an array. However, it seems the swiper needs to be rerendered after the map completes.
const colorParams = {
slidesPerView: 3,
spaceBetween: 30,
freeMode: true,
rebuildOnUpdate: true
};
<Swiper {...colorParams}>
{
ColorOptions.map((color) => {
return (
<ColorCircle /> /* puedo component code */
);
})
}
</Swiper>
I don't see anything in the docs about this and am hoping I'm just missing something. All of my other testing looks to work fine up until I try to populate the slider with a map method.
Hi @yuschick , u can use params rebuildOnUpdate: true or shouldSwiperUpdate : true. If u wanna rebuild Swiper each time component got re-rendered , just use rebuildOnUpdate. If u wanna update Swiper only, just use shouldSwiperUpdate
worked like a charm i was using it in params but should be used like below
It's not working!
In your object colorParams include the following propertie
rebuildOnUpdate: true
Neither props are recognized by react...
React does not recognize the rebuildOnUpdate prop
React does not recognize the shouldSwiperUpdate prop
Most helpful comment
It's not working!