Closed jbowa closed 3 years ago
@jbowa Hi! Regarding this, i thought about introducing it, but this means that i need to keep a state variable inside the carousel, which means that i will need to trigger a React re rendering, which i want to avoid as much as possible for performance reasons (also because i would add something that maybe not anyone needs). I guess that you can replicate the logic outside the carousel and using the useListenToCustomEvent
and checking the current active item and matching with your array of items. I've done that in other projects. Please let me know if that can help :)
This makes a lot of sense, I will go with useListenToCustomEvent
- Thank you for all the great work!
Hey Emiliano,
I can't see this from the current API - but is there a way to check if next or previous items exist? It would be useful in rendering the back and forward buttons if we had
hasNext: boolean
orhasPrevious: boolean
which would allow us to conditionally render the buttons. Thank you