@@ -17,6 +17,7 @@ import AnimatedValue from '../../../Libraries/Animated/nodes/AnimatedValue';
1717import { isPublicInstance as isFabricPublicInstance } from '../../../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils' ;
1818import { RootTagContext } from '../../../Libraries/ReactNative/RootTag' ;
1919import useRefEffect from '../../../Libraries/Utilities/useRefEffect' ;
20+ import warnOnce from '../../../Libraries/Utilities/warnOnce' ;
2021import * as ReactNativeFeatureFlags from '../featureflags/ReactNativeFeatureFlags' ;
2122import { createAnimatedPropsMemoHook } from './createAnimatedPropsMemoHook' ;
2223import NativeAnimatedHelper from './NativeAnimatedHelper' ;
@@ -52,9 +53,6 @@ export default function createAnimatedPropsHook(
5253) : AnimatedPropsHook {
5354 const useAnimatedPropsMemo = createAnimatedPropsMemoHook ( allowlist ) ;
5455
55- const useNativePropsInFabric =
56- ReactNativeFeatureFlags . shouldUseSetNativePropsInFabric ( ) ;
57-
5856 return function useAnimatedProps < TProps extends { ...} , TInstance > (
5957 props : TProps ,
6058 ) : [ ReducedProps < TProps > , CallbackRef < TInstance | null > ] {
@@ -145,6 +143,17 @@ export default function createAnimatedPropsHook(
145143 return ;
146144 }
147145
146+ // TODO: T274006331 - Remove js-only animation once shared backend is fully rolled out
147+ const isNativeDriverForced =
148+ NativeAnimatedHelper . isNativeDriverForced ( ) ;
149+ if ( isNativeDriverForced ) {
150+ warnOnce (
151+ 'animated-force-native-driver-js-update' ,
152+ 'Animated: Expected the animation node to use the native driver when the native driver is forced.' ,
153+ ) ;
154+ return ;
155+ }
156+
148157 if (
149158 typeof instance !== 'object' ||
150159 typeof instance ?. setNativeProps !== 'function'
@@ -160,6 +169,8 @@ export default function createAnimatedPropsHook(
160169 return instance . setNativeProps ( node . __getAnimatedValue ( ) ) ;
161170 }
162171
172+ const useNativePropsInFabric =
173+ ReactNativeFeatureFlags . shouldUseSetNativePropsInFabric ( ) ;
163174 if ( ! useNativePropsInFabric ) {
164175 // Check 5: setNativeProps are disabled.
165176 return scheduleUpdate ( ) ;
0 commit comments