From d2723b8ed791414754f2690572caa4d2daeb7817 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 20 Nov 2024 07:25:56 -0800 Subject: [PATCH] delete feature flag useSetNativePropsInNativeAnimationsInFabric Summary: changelog: [internal] Reviewed By: dmytrorykun Differential Revision: D66230767 fbshipit-source-id: 8f133a313e42a5dc7136e88a3ce68835d420ced9 --- .../Libraries/Animated/useAnimatedProps.js | 16 ++-------------- .../ReactNativeFeatureFlags.config.js | 9 --------- .../featureflags/ReactNativeFeatureFlags.js | 8 +------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/packages/react-native/Libraries/Animated/useAnimatedProps.js b/packages/react-native/Libraries/Animated/useAnimatedProps.js index 134234dacbf..7a058f8882c 100644 --- a/packages/react-native/Libraries/Animated/useAnimatedProps.js +++ b/packages/react-native/Libraries/Animated/useAnimatedProps.js @@ -73,8 +73,6 @@ export default function useAnimatedProps( const useNativePropsInFabric = ReactNativeFeatureFlags.shouldUseSetNativePropsInFabric(); - const useSetNativePropsInNativeAnimationsInFabric = - ReactNativeFeatureFlags.shouldUseSetNativePropsInNativeAnimationsInFabric(); const useAnimatedPropsLifecycle = ReactNativeFeatureFlags.useInsertionEffectsForAnimations() @@ -119,12 +117,7 @@ export default function useAnimatedProps( if (isFabricNode) { // Call `scheduleUpdate` to synchronise Fiber and Shadow tree. // Must not be called in Paper. - if (useSetNativePropsInNativeAnimationsInFabric) { - // $FlowFixMe[incompatible-use] - instance.setNativeProps(node.__getAnimatedValue()); - } else { - scheduleUpdate(); - } + scheduleUpdate(); } return; } @@ -201,12 +194,7 @@ export default function useAnimatedProps( } }; }, - [ - node, - useNativePropsInFabric, - useSetNativePropsInNativeAnimationsInFabric, - props, - ], + [node, useNativePropsInFabric, props], ); const callbackRef = useRefEffect(refEffect); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 541530b603d..71c40e6814f 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -554,15 +554,6 @@ const definitions: FeatureFlagDefinitions = { purpose: 'experimentation', }, }, - shouldUseSetNativePropsInNativeAnimationsInFabric: { - defaultValue: false, - metadata: { - dateAdded: '2024-03-05', - description: - 'Enables use of setNativeProps in Native driven animations in Fabric.', - purpose: 'experimentation', - }, - }, useInsertionEffectsForAnimations: { defaultValue: true, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index bed5d9990a4..8adc1c0fe3d 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<36e8036fd1f45794c37a6fa22cde9b05>> * @flow strict */ @@ -42,7 +42,6 @@ export type ReactNativeFeatureFlagsJsOnly = { shouldUseAnimatedObjectForTransform: Getter, shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter, shouldUseSetNativePropsInFabric: Getter, - shouldUseSetNativePropsInNativeAnimationsInFabric: Getter, useInsertionEffectsForAnimations: Getter, useRefsForTextInputState: Getter, }; @@ -174,11 +173,6 @@ export const shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter = cre */ export const shouldUseSetNativePropsInFabric: Getter = createJavaScriptFlagGetter('shouldUseSetNativePropsInFabric', true); -/** - * Enables use of setNativeProps in Native driven animations in Fabric. - */ -export const shouldUseSetNativePropsInNativeAnimationsInFabric: Getter = createJavaScriptFlagGetter('shouldUseSetNativePropsInNativeAnimationsInFabric', false); - /** * Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`. */