-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Animations in recycled components seem to be broken from v3.9.0 and up #6203
Comments
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? |
I'm also seeing this - specifically, |
I've had to stick to 3.6.2 to not break my animations with FlashList (it's especially noticeable when mid-scroll and updating objects in an array). |
Hey @erquhart @LeslieOA @LcTwisk could please try out the following patch? |
I’m using Expo prebuild, but will see if I can create a confit plugin (or use build properties [???]) to apply the patch. |
That's essentially reverting #5268, right? Yes, we're using a similar patch at the moment, and it fixed the issues we experienced 👍 |
## Summary Unfortunately, turns out the PR with dynamic styles #5268 introduced more problems than it solved. Thus, proposing a revert. This revert most likely fixed: - #6203 - #6102 - #6037 as well as one more not-published issue and potentially a few more. ## Notes Even if it gets approved, to be merged ONLY after @tjzel agrees with everything ## Test plan 😢 😭
The fix should be there by the next stable version (3.14.0 or next iteration of 3.13.x) |
@LcTwisk do you mind giving a small explaination on how you've used |
@szydlovsky sorry it took so long to try this out - still broken for me as of 3.10.1. Edit: apparently I can't read, you said 3.13x+. I'll try the actual patch. Update: installed 3.14.0, works! Thanks! |
Description
The changes in #5268 result in animations not properly resetting when a component is being recycled in e.g. a FlashList (even if the
SharedValue
's backing the animation are reset.Was able to work around it by explicitly setting a property that would change when recycling. That results in the
_requiresNewInitials
here to become true (because of a change in props). However, I'm not sure if this is the intended solution for recycling. Any thoughts?<Animated.View + key={index} style={animatedStyle} height={height} onLayout={onLayout} />
A video showing the issue in our app:
The following can be observed: an animation is triggered on component 1, but the state is not being reset when the component is recycled on index 11 (there's a recycle pool of 10 components).
The backing
SharedValue
's are being reset when the component is recycled:RPReplay_Final1719850658.MP4
Steps to reproduce
Snack or a link to a repository
Will create a reproduction project later
Reanimated version
3.9.0 (and up)
React Native version
0.72.14
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: