From 07df82b4e17027d6194fee0b3cee045bef3b6686 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Tue, 18 Apr 2023 02:39:36 -0700 Subject: [PATCH] Remove gating for AnimatedObject (#36934) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36934 Embarrassingly, the check for ReactNativeFeatureFlags.isAnimatedObjectEnabled wasn't actually useful since it's a function...it's been working as expected, so remove this gating since it's not doing anything. Changelog: [Internal] - Remove gating for AnimatedObject Reviewed By: mdvacca Differential Revision: D45055855 fbshipit-source-id: c30b3c04efc0e919059dbcb75a5adfea90610b85 --- .../react-native/Libraries/Animated/nodes/AnimatedProps.js | 6 +----- .../react-native/Libraries/Animated/nodes/AnimatedStyle.js | 6 +----- .../Libraries/ReactNative/ReactNativeFeatureFlags.js | 5 ----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedProps.js b/packages/react-native/Libraries/Animated/nodes/AnimatedProps.js index 0ce27f41d64..d6c3462590b 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedProps.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedProps.js @@ -12,7 +12,6 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags'; import {findNodeHandle} from '../../ReactNative/RendererProxy'; import {AnimatedEvent} from '../AnimatedEvent'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; @@ -29,10 +28,7 @@ function createAnimatedProps(inputProps: Object): Object { props[key] = new AnimatedStyle(value); } else if (value instanceof AnimatedNode) { props[key] = value; - } else if ( - ReactNativeFeatureFlags.isAnimatedObjectEnabled && - hasAnimatedNode(value) - ) { + } else if (hasAnimatedNode(value)) { props[key] = new AnimatedObject(value); } else { props[key] = value; diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js b/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js index eb48cd79fe2..86a100f485e 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js @@ -12,7 +12,6 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags'; import flattenStyle from '../../StyleSheet/flattenStyle'; import Platform from '../../Utilities/Platform'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; @@ -34,10 +33,7 @@ function createAnimatedStyle( animatedStyles[key] = new AnimatedTransform(value); } else if (value instanceof AnimatedNode) { animatedStyles[key] = value; - } else if ( - ReactNativeFeatureFlags.isAnimatedObjectEnabled && - hasAnimatedNode(value) - ) { + } else if (hasAnimatedNode(value)) { animatedStyles[key] = new AnimatedObject(value); } else if (keepUnanimatedValues) { animatedStyles[key] = value; diff --git a/packages/react-native/Libraries/ReactNative/ReactNativeFeatureFlags.js b/packages/react-native/Libraries/ReactNative/ReactNativeFeatureFlags.js index eb0e2fd29f5..8881d287fe5 100644 --- a/packages/react-native/Libraries/ReactNative/ReactNativeFeatureFlags.js +++ b/packages/react-native/Libraries/ReactNative/ReactNativeFeatureFlags.js @@ -45,10 +45,6 @@ export type FeatureFlags = {| * Enables access to the host tree in Fabric using DOM-compatible APIs. */ enableAccessToHostTreeInFabric: () => boolean, - /** - * Enables animating object and array prop values. - */ - isAnimatedObjectEnabled: () => boolean, |}; const ReactNativeFeatureFlags: FeatureFlags = { @@ -59,7 +55,6 @@ const ReactNativeFeatureFlags: FeatureFlags = { animatedShouldUseSingleOp: () => false, isGlobalWebPerformanceLoggerEnabled: () => false, enableAccessToHostTreeInFabric: () => false, - isAnimatedObjectEnabled: () => false, }; module.exports = ReactNativeFeatureFlags;