mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
9e6ba9ddb8
Summary: In Fabric, there are two subtle differences in Animated: 1) On the native side, queued NativeAnimated operations are executed more frequently 2) On the JS side there seems to be a bigger gap between AnimatedNodes being set up, and the final `componentDidMount`/`componentDidUpdate` that results in `_attachNativeEvents` being called. This results in some visual glitching for certain features like StickyScrollViewHeader and other animations that are frequently rerendered. Rerendering an animated component relies on sync-like behavior (new animations must be set up in the same frame that old animations are torn down, and the UI must flush any updates in the same frame). This sync-like behavior is trickier to achieve in Fabric, so we introduce this mechanism, in Fabric only, to queued operations more aggressively on the JS side and only flush them when `componentDidMount`/`componentDidUpdate` have been called on all relevant nodes. This seems to resolve longstanding issues with animations in Fabric on Android. There are unrelated issues on iOS that make this difficult to test currently, so I'll keep the new path Android-only for now. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D22801173 fbshipit-source-id: 3db2235483636c9074df941cfac0a30f3f97545a