6

I am using react-native-reanimated-carousel ^2.5.0 and it does show photos as it should but when I try to swipe left or right it does not do anything, it does not scroll nor shows any errors.

Here are dependencies related to it:

"react-native-reanimated": "^2.4.1",
"react-native-reanimated-carousel": "^2.5.0",
"react-native-gesture-handler": "^2.4.2",

and here is the Carousel code:

<Carousel
  width={windowWidth * 1.1}
  data={newImgArr}
  windowSize={10}
  loop={true}
  mode={'parallax'}
  autoPlay={false}
  renderItem={({ item }, index) => {
     return (
        <FastImage
           source={{
              uri: item,
              priority: FastImage.priority.high,
              cache: FastImage.cacheControl.immutable,
           }}
           style={{ flex: 1 }}
           resizeMode={FastImage.resizeMode.cover}
        />
     );
  }}
/>

I would really appreciate some help here!

showtime
  • 1
  • 1
  • 17
  • 48
  • 1
    If you use the inspector to choose a visual element on the screen, is the carousel selectable or is there something over it? Shake device -> Show inspector – Abe May 29 '22 at 23:49
  • @Abe I cant detect if there is anything but it doesnt seem like. I click on the opened photo and it selects the photo frame so I guess there is nothing in front – showtime May 31 '22 at 18:14
  • @showtime which device are you using? I get manual swiping working on the web and iPhone, but not the android. – dustydojo Jun 04 '22 at 01:01
  • @dustydojo I use android – showtime Jun 06 '22 at 17:17

1 Answers1

18

This problem was already mentioned in a resolved issue.

You just have to wrap your Carousel in GestureHandlerRootView.

export default function App() {
  return <GestureHandlerRootView>{/* content */}</GestureHandlerRootView>;
}
oxidia
  • 196
  • 2
  • 5