[Perf] TeactN: Leverage getIsHeavyAnimating.once instead of recursed requestMeasure

This commit is contained in:
Alexander Zinchuk 2024-09-19 20:43:46 +02:00
parent 94a9f7eba8
commit 22019bc86c

View File

@ -5,7 +5,6 @@ import arePropsShallowEqual, { logUnequalProps } from '../../util/arePropsShallo
import { handleError } from '../../util/handleError';
import { orderBy } from '../../util/iteratees';
import { throttleWithTickEnd } from '../../util/schedulers';
import { requestMeasure } from '../fasterdom/fasterdom';
import React, { DEBUG_resolveComponentName, getIsHeavyAnimating, useUnmountCleanup } from './teact';
import useForceUpdate from '../../hooks/useForceUpdate';
@ -75,7 +74,7 @@ function runCallbacks() {
if (forceOnHeavyAnimation) {
forceOnHeavyAnimation = false;
} else if (getIsHeavyAnimating()) {
requestMeasure(runCallbacksThrottled);
getIsHeavyAnimating.once(runCallbacksThrottled);
return;
}