dohooo / react-native-reanimated-carousel

🎠 React Native swiper/carousel component, fully implemented using reanimated v2, support to iOS/Android/Web. (Swiper/Carousel)
https://react-native-reanimated-carousel.vercel.app
MIT License
2.58k stars 293 forks source link

Mismatch between website documentation and implementation #621

Open mkhalila opened 3 weeks ago

mkhalila commented 3 weeks ago

Hey, I'm new to using RNRC and I'm on version 3.5.1. The docs (https://reanimated-carousel.dev/usage) on this page mention two things that I can't seem to use in the current version:

  1. onConfigurePanGesture: when I try pass this prop in I get a Property 'onConfigurePanGesture' does not exist.... I'd like to get this working because I am rendering multiple horizontal carousels within a vertical ScrollView and I'd like vertical scrolls to be handled by the ScrollView and not be 'hijacked' by the Carousel.
  2. Pagination: when I try to import it like the docs, I get a: Module '"react-native-reanimated-carousel"' has no exported member 'Pagination'.
import ReanimatedCarousel, {
  ICarouselInstance,
  Pagination
} from "react-native-reanimated-carousel";

Thanks in advance.

dosubot[bot] commented 3 weeks ago

Hey there, @mkhalila! I'm here to help you with any bugs, questions, or contributions you may have. Let's see what's going on with the React Native Reanimated Carousel and get it sorted out for you.

The issues you are encountering are likely due to the version of react-native-reanimated-carousel you are using. The features onConfigurePanGesture and Pagination are not available in version 3.5.1, but they are present in version 4.0.0-alpha.12.

To resolve these issues, you need to upgrade to version 4.0.0-alpha.12. You can do this by updating your package.json or running the following command:

yarn add react-native-reanimated-carousel@4.0.0-alpha.12

After upgrading, you should be able to use the onConfigurePanGesture prop and import Pagination as shown in the documentation.

Here is the corrected import statement:

import ReanimatedCarousel, {
  ICarouselInstance,
  Pagination
} from "react-native-reanimated-carousel";

And you can use the onConfigurePanGesture prop like this:

<ReanimatedCarousel
  onConfigurePanGesture={(e) => {
    // Your configuration logic here
  }}
  // other props
/>

Make sure to follow the documentation for any additional setup or usage instructions specific to version 4.0.0-alpha.12 [1].

To continue talking to Dosu, mention @dosu.