HI,thank you for making this useful tool,I have some problems
{list.map((item, index) => {
return (
<div key={index}>
slide
</div>
)
}) : null
}
but swiper doesn`t work,I can't drag it,please tell me how to solve this problem,thank you!
Do you have any console errors. Have you imported the swiper css stylesheet from node_modules?
There are no errors here,I have imported the swiper css from node_modules. I find that if code like the example will be ok,Have you ever used Array.map to create elements?
Yes, using Array.map is fine as long as your wrap the slides with a <div>. You are doing this correctly. What are you doing with : null on line 7 of your example?
that is needless code, I have deleted it , but it doesn`t work. I will try again. thanks a lot!
I have the same problem.
With map(), the additionnal css are not applied to dynamic element generated by the map(), even if we using
Can you provide your code? I don’t understand what you mean.
Found my solution after 2 hours.
For dynamic data, I have to use : rebuildOnUpdate: true.
Because I use {this.props.children}.
So the divs are read by Swiper but Swiper don't apply anything on them. It's like he receive the divs after the initialization...
So rebuildOnUpdate, do the job once.
@Steffi3rd How do you save navigation position?
Set shouldSwiperUpdate={true}. Worked for me.
Most helpful comment
Found my solution after 2 hours.
For dynamic data, I have to use : rebuildOnUpdate: true.
Because I use {this.props.children}.
So the divs are read by Swiper but Swiper don't apply anything on them. It's like he receive the divs after the initialization...
So rebuildOnUpdate, do the job once.