Multiple items questions #17
-
Hi! First of all, thank you so much for creating this! It has to be one of the best carousel management APIs I've ever used, I have to admit. I have begun using it, using it for the majority of the use cases I have encountered. There are just two scenarios that I don't know how to handle.
Note: I was thinking of iterating my items first and grouping them by pairs, and then having just one page. but wanted to make sure first if there is a way that is not a workaround.
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@diegogutierrez-dev Hi! :) So, for your use case n°1, currently it isn't possible, though I'm exploring the possibility to do it internally in v3. I would say that, at the moment, the only way to do it is by iterating and grouping the items by yourself as you said (inside
For your use case n°2, as above, at the moment it isn't possible. You can do it by using the hook Here's an example of how it's being used -> https://react-spring-carousel.emilianobucci.com/docs/events. The carousel used in the home page works this way. (every component used in the carousel check if itself is the active one - inside the hook callback - and then set it's internal state; this way the carousel don't suffer from external rerenders, just the internal component). Please let me know if that's help (for the moment) or if you need further assistance. :) Note: I intend to release together with v3 lots of examples that should cover most common use cases but as the library is being adopted more and more i would like to ask folks what could be added to improve it (maybe I will open a discussion) since this project was born only for personal usage and I didn't expect that people will start using it :D |
Beta Was this translation helpful? Give feedback.
@diegogutierrez-dev Hi! :)
So, for your use case n°1, currently it isn't possible, though I'm exploring the possibility to do it internally in v3. I would say that, at the moment, the only way to do it is by iterating and grouping the items by yourself as you said (inside
renderItem
you will have to render 2 items instead as one).For your use case n°2, as above, at the moment it isn't possible. You can do it by using the hook
useListenToCustomEvent
inside your carousel components (this way you can customize your component in any way you want).Here's an example of how it's being used -> https:/…