Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: useAnimatedScrollHandler is not working properly with React Native FlashList in version 3.9+ #5970

Closed
prince-d-simform opened this issue May 2, 2024 · 5 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS

Comments

@prince-d-simform
Copy link

Description

useAnimatedScrollHandler is working perfectly fine with reanimated version <= 3.8 but with recent versions >= 3.9 it is not working

import Animated, { useAnimatedScrollHandler } from 'react-native-reanimated';

import { FlashList, FlashListProps } from '@shopify/flash-list';

const AnimatedFlashList =
  Animated.createAnimatedComponent<FlashListProps<StoriesType>>(FlashList);
const onScroll = useAnimatedScrollHandler(event => {
    scrollX.value = event.contentOffset.x;
});

<AnimatedFlashList
     horizontal
     pagingEnabled       
     data={stories}
     onScroll={onScroll}
 />

Steps to reproduce

  1. Use React Native FlashList: https://github.com/Shopify/flash-list
  2. Use React Native Reanimated version >= 3.9
  3. Create animatedComponent of Flashlist
  4. Use that AnimatedFlashList
  5. Use onScroll method with useAnimatedScrollHandler

Snack or a link to a repository

N/A

Reanimated version

3.9.0

React Native version

0.71.5

Platforms

Android, iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Missing repro This issue need minimum repro scenario labels May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@emzet93
Copy link

emzet93 commented May 2, 2024

I can confirm that. Worked perfectly with reanimated 3.8.1. Today I upgraded to 3.10 and it broke :(

@emzet93
Copy link

emzet93 commented May 2, 2024

@prince-d-simform see this #5941.

@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

Sorry to hear that, we'll need to take a closer look.

@szydlovsky Could you please investigate this issue?

@szydlovsky
Copy link
Contributor

Hi @prince-d-simform it is a duplicate issue: #5941. You can follow the updates in its comment section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

4 participants