Skip to content

onUserDrivenAnimationEnded: when ending scrolling, all Animated.Views re-render, which makes the app unresponsive #55149

@tomvankruijsbergen

Description

@tomvankruijsbergen

Description

On ending scrolling, onUserDrivenAnimationEnded is triggered on every Animated.View, which causes them all to re-render. On apps with more complex views such as ours, that results in 200+ re-renders that are not useful, and the mqtjs thread is 100% full, which makes the app fully unresponsive while those re-renders are happening.

If I comment this line out, the app is performant again, but ofcourse this line is there for a reason, so I don't know which bugs I am now inviting to the app. What is the proper fix? Or can we somehow prevent most of the views from re-rendering through some logic?

Related: #36504 (comment)

Steps to reproduce

  1. Run the snack.
  2. Scroll a bit, then try to tap any of the squares.
  3. See that this either is very delayed, or doesn't happen at all.
  4. In profiling, see that all components re-render.

Note: this is much, much more pronounced on Android.

Notes on the Snack:

  • If you remove the Animated.Event from the animated scroll view, the problem disappears.
  • If you remove the scaleA animation, which is there as an example animation, the problem disappears.
  • TouchableOpacity is just there to have a pressable Animated.View; the problem also happens if these are plain Animated.View.

React Native Version

0.80.2

Affected Platforms

Runtime - Android, Runtime - iOS, Build - MacOS

Areas

Fabric - The New Renderer

Output of npx @react-native-community/cli info

System:
  OS: macOS 14.4.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Memory: 1.73 GB / 32.00 GB
  Shell:
    version: 3.7.1
    path: /usr/local/bin/fish
Binaries:
  Node:
    version: 20.13.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.5.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.06.23.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11842104
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.1.1
    wanted: 19.1.1
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.2
    wanted: 0.80.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

See description!

MANDATORY Reproducer

https://snack.expo.dev/@tomvankruijsbergen/rn-animatedvalue

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: AnimatedNeeds: Author FeedbackStaleThere has been a lack of activity on this issue and it may be closed soon.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)Type: Unsupported VersionIssues reported to a version of React Native that is no longer supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions