Skip to content

Commit

Permalink
Delete redundant calls to flushQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 4, 2024
1 parent dda3397 commit b648971
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/react-native/Libraries/Animated/useAnimatedProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ function useAnimatedPropsLifecycle_layoutEffects(node: AnimatedProps): void {
const userDrivenAnimationEndedListener = useRef<?EventSubscription>(null);

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();

if (node.__isNative) {
userDrivenAnimationEndedListener.current =
NativeAnimatedHelper.nativeEventEmitter.addListener(
Expand Down Expand Up @@ -313,13 +308,6 @@ function useAnimatedPropsLifecycle_passiveEffects(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();
});

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

0 comments on commit b648971

Please sign in to comment.