React-id-swiper: What do `shouldSwiperUpdate` and `rebuildOnUpdate` properties do?

Created on 22 Aug 2019  路  5Comments  路  Source: kidjp85/react-id-swiper

The documentation is not clear about what does each of those properties do.
https://react-id-swiper.ashernguyen.site/doc/api

I supposed those two properties are for dynamic children.
When should one use shouldSwiperUpdate and when should one use rebuildOnUpdate?

I added shouldSwiperUpdate and seems that it works.
What for is the rebuildOnUpdate then?

Most helpful comment

You should learn about Swiper itself first :)

Honestly, no one wants to learn anything about anything.
You don't have to explain what those properties mean but you should also know that this is not something that everyone just knows what it means.
This issue can be closed: the purpose of it is so that other people searching "Issues" by those keywords would find this discussion and maybe then they could leave an explanation of what those properties mean.
I can say that shouldSwiperUpdate makes the component update correctly if the slides have changed.
That's my use case.

All 5 comments

I think it's quite clear. shouldSwiperUpdate will make swiper instance to update, while rebuildOnUpdate make swiper create new instance each time when React component update

shouldSwiperUpdate will make swiper instance to update

When?
What does "updating swiper instance" mean?

while rebuildOnUpdate make swiper create new instance each time when React component update

When should a user "create a new instance each time when React component update"?

You should learn about Swiper itself first :)

You should learn about Swiper itself first :)

Honestly, no one wants to learn anything about anything.
You don't have to explain what those properties mean but you should also know that this is not something that everyone just knows what it means.
This issue can be closed: the purpose of it is so that other people searching "Issues" by those keywords would find this discussion and maybe then they could leave an explanation of what those properties mean.
I can say that shouldSwiperUpdate makes the component update correctly if the slides have changed.
That's my use case.

Thanks @catamphetamine. I spent yesterday 4-5 hours to figured it out. But I got the answer from your question what I wanted to do exactly.

Was this page helpful?
0 / 5 - 0 ratings