pavelbabenko / react-native-awesome-gallery

Performant, native-like, and well-customizable gallery for React Native.
MIT License
498 stars 54 forks source link

Buggy swiping behavior with react-native-reanimated >= 3.9.0 #75

Closed andrijanovakovic closed 3 months ago

andrijanovakovic commented 6 months ago

Environment

Description

There seems to be an issue with swiping images, which becomes buggy when using react-native-reanimated version 3.9.0 or higher. When using react-native-reanimated 3.8.1 or older (tried with 3.6.2 also) swiping is smooth.

When swiping images, the image seems to come almost to the end of screen (~80% of the swipe) and then for a moment it jumps back and forth a bit, before positioning to the end of screen (end of swipe). It's hard to explain so please look at the attached videos below.

Steps to Reproduce

  1. Set up an Expo project with the latest version of react-native-awesome-gallery.
  2. Ensure that react-native-reanimated is updated to version 3.9.0 or higher.
  3. Implement a basic gallery view with multiple images to swipe through.
  4. Observe the swiping behavior.

Expected Behavior

Swiping between images should be smooth and seamless.

Actual Behavior

Swiping is buggy and does not provide a smooth experience.

Additional Information

No warnings or error messages are displayed. I am using Expo SDK 51 & expo-router 3.5 which requires reanimated library version >= 3.10 so downgrading to an older reanimated version is not an option.
I have also tried this in versions 3.11.0 which is also buggy and 3.8.1 which is not buggy.

Videos

react-native-reanimated@3.6.2 (example of smooth swiping)

https://github.com/pavelbabenko/react-native-awesome-gallery/assets/24866268/c0bc0b2e-3138-4143-9523-882514805415

react-native-reanimated@3.10.1 (example of jittery/buggy swiping)

https://github.com/pavelbabenko/react-native-awesome-gallery/assets/24866268/997a9c1b-f180-437a-9aef-18e3d6469569

jacobmolby commented 6 months ago

I don't think this lib has anything to do with it. From version 3.7 reanimated has become slow. We're stuck at 3.6 for the time being.

I already created an issue in their repo https://github.com/software-mansion/react-native-reanimated/issues/5816

pavelbabenko commented 3 months ago

@andrijanovakovic @jacobmolby Could you try with reanimated v3.14 and reopen the issue if it still exists?

jacobmolby commented 3 months ago

I haven't tried directly with this lib, but the same issues occur in the new version as well https://github.com/software-mansion/react-native-reanimated/issues/5816#issuecomment-2244877878