-
Thanks for the help :D |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
🤖 Hey @djokhar05! Great to see you back here, hope you're doing awesome. 😄 To start the carousel from a specific index, you can use the <Carousel
defaultIndex={2}
// other props
/> For moving the carousel's index to the next item using a button click, you can use the import { Carousel } from 'react-native-reanimated-carousel';
// Assuming you have a carouselController from useCarouselController
const { next } = carouselController;
// Your Carousel component
<Carousel
defaultIndex={2}
carouselController={carouselController}
// other props
/>
// Your button
<Button title="Next" onPress={next} /> Please note that the <Carousel
defaultIndex={2}
carouselController={carouselController}
loop={true}
// other props
/> I hope this helps! If you have any other questions, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
Perfect, thank you so much, the speed at which the anwer was given is more than amazing, thanks a lot. But I can't seem to find where to import useCarouselController from |
Beta Was this translation helpful? Give feedback.
🤖
Hey @djokhar05! Great to see you back here, hope you're doing awesome. 😄
To start the carousel from a specific index, you can use the
defaultIndex
prop in theCarousel
component. In your case, if you want to start from index 2, you can do it like this:For moving the carousel's index to the next item using a button click, you can use the
next
function from thecarouselController
. Here's how you can do it: