Skip to content

Commit dc369f5

Browse files
dmytrorykunfacebook-github-bot
authored andcommitted
Prepare to using setNativeProps for Fabric native animations (facebook#45387)
Summary: Pull Request resolved: facebook#45387 This diff prepares an experiment to test `setNativeProps` for syncing the final state of native driven animations with Fabric. Changelog: [Internal] Reviewed By: javache Differential Revision: D59634489
1 parent c4a6bbc commit dc369f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-native/Libraries/Animated/useAnimatedProps.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
8787
if (isFabricNode) {
8888
// Call `scheduleUpdate` to synchronise Fiber and Shadow tree.
8989
// Must not be called in Paper.
90-
scheduleUpdate();
90+
if (useNativePropsInFabric) {
91+
// $FlowFixMe[incompatible-use]
92+
instance.setNativeProps(node.__getAnimatedValue());
93+
} else {
94+
scheduleUpdate();
95+
}
9196
}
9297
return;
9398
}

0 commit comments

Comments
 (0)