Skip to content

Commit

Permalink
Prepare to using setNativeProps for Fabric native animations
Browse files Browse the repository at this point in the history
Summary:
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
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Jul 11, 2024
1 parent c4a6bbc commit d14b031
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-native/Libraries/Animated/useAnimatedProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
if (isFabricNode) {
// Call `scheduleUpdate` to synchronise Fiber and Shadow tree.
// Must not be called in Paper.
scheduleUpdate();
if (useNativePropsInFabric) {
// $FlowFixMe[incompatible-use]
return instance.setNativeProps(node.__getAnimatedValue());
} else {
return scheduleUpdate();
}
}
return;
}
Expand Down

0 comments on commit d14b031

Please sign in to comment.