From 6f40f517832e0e13b07c5da1dfb8139c53a57207 Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Tue, 1 Dec 2026 11:26:48 -0800 Subject: [PATCH] Remove the internal option to skip Native Animated frames while inactive (#60442) Summary: Removes `initWithSkipFramesDuringForegroundTransition:` and `RCTAnimatedModuleProvider+Private.h`. `RCTAnimatedModuleProvider` no longer skips display link frames while the application is inactive; plain `init` behavior is unchanged. `SkipFramesDuringForegroundTransition` was set up as a hypothetical fix for ios crash at app foregrounding; but it wasn't proved as the right fix. Changelog: [Internal] Differential Revision: D135414196 --- .../RCTAnimatedModuleProvider+Private.h | 20 -------------- .../RCTAnimatedModuleProvider.mm | 27 ------------------- 2 files changed, 47 deletions(-) delete mode 100644 packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider+Private.h diff --git a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider+Private.h b/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider+Private.h deleted file mode 100644 index 062cd4e106e0..000000000000 --- a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider+Private.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#import - -@interface RCTAnimatedModuleProvider (Private) - -/** - * When true, animated frames are skipped while the application is inactive (between - * `UIApplicationWillEnterForeground` -> `UIApplicationDidBecomeActive`), default is false. - */ -- (instancetype)initWithSkipFramesDuringForegroundTransition:(BOOL)skipFramesDuringForegroundTransition; - -@end diff --git a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm b/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm index 71a3c8d9e147..17914749a512 100644 --- a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm +++ b/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm @@ -7,15 +7,12 @@ #import "RCTAnimatedModuleProvider.h" -#import "RCTAnimatedModuleProvider+Private.h" - #import #if TARGET_OS_OSX #import #else #import -#import #endif #import @@ -31,21 +28,6 @@ @implementation RCTAnimatedModuleProvider { std::function _onRender; std::weak_ptr _nativeAnimatedNodesManagerProvider; - - BOOL _skipFramesDuringForegroundTransition; -} - -- (instancetype)init -{ - return [self initWithSkipFramesDuringForegroundTransition:NO]; -} - -- (instancetype)initWithSkipFramesDuringForegroundTransition:(BOOL)skipFramesDuringForegroundTransition -{ - if (self = [super init]) { - _skipFramesDuringForegroundTransition = skipFramesDuringForegroundTransition; - } - return self; } - (void)dealloc @@ -79,15 +61,6 @@ - (void)_onDisplayLinkTick // use-after-free during hot reload. The provider must remain alive for the // entire duration of _onRender() since it holds references to the animation // nodes manager and related data structures. -#if !TARGET_OS_OSX - // See initWithSkipFramesDuringForegroundTransition: the frame is skipped, - // never the clock. - if (_skipFramesDuringForegroundTransition && - UIApplication.sharedApplication.applicationState == UIApplicationStateInactive) { - return; - } -#endif - auto strongProvider = _nativeAnimatedNodesManagerProvider.lock(); if (strongProvider != nullptr && _displayLink != nullptr && _onRender != nullptr) { _onRender();