Skip to content

Commit

Permalink
Delete redundant calls to flushQueue (facebook#46327)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 16, 2024
1 parent 68a92aa commit 94a5f31
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/react-native/Libraries/Animated/useAnimatedProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ function useAnimatedPropsLifecycle_layoutEffects(node: AnimatedProps): void {
const isUnmountingRef = useRef<boolean>(false);

useEffect(() => {
// It is ok for multiple components to call `flushQueue` because it noops
// if the queue is empty. When multiple animated components are mounted at
// the same time. Only first component flushes the queue and the others will noop.
NativeAnimatedHelper.API.flushQueue();
let drivenAnimationEndedListener: ?EventSubscription = null;
if (node.__isNative) {
drivenAnimationEndedListener =
Expand Down Expand Up @@ -326,13 +322,6 @@ function useAnimatedPropsLifecycle_insertionEffects(node: AnimatedProps): void {
const prevNodeRef = useRef<?AnimatedProps>(null);
const isUnmountingRef = useRef<boolean>(false);

useEffect(() => {
// It is ok for multiple components to call `flushQueue` because it noops
// if the queue is empty. When multiple animated components are mounted at
// the same time. Only first component flushes the queue and the others will noop.
NativeAnimatedHelper.API.flushQueue();
});

useInsertionEffect(() => {
isUnmountingRef.current = false;
return () => {
Expand Down

0 comments on commit 94a5f31

Please sign in to comment.