Skip to content

Commit 627dde7

Browse files
zeyapfacebook-github-bot
authored andcommitted
do not post callback in AnimationBackendChoreographer.kt if featureflag is off
Summary: ## Changelog: [Internal] - do not post callback in AnimationBackendChoreographer.kt if featureflag is off AnimationBackendChoreographer is initialized in android regardless of featureflag, and it posts no-op per frame callbacks regardless, which is not ideal Differential Revision: D109607144
1 parent 2bbd70a commit 627dde7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package com.facebook.react.fabric
1010
import com.facebook.proguard.annotations.DoNotStripAny
1111
import com.facebook.react.bridge.ReactApplicationContext
1212
import com.facebook.react.bridge.UiThreadUtil
13+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
1314
import com.facebook.react.modules.core.ReactChoreographer
1415
import com.facebook.react.uimanager.GuardedFrameCallback
1516
import java.util.concurrent.atomic.AtomicBoolean
@@ -41,9 +42,11 @@ internal class AnimationBackendChoreographer(
4142
private val paused: AtomicBoolean = AtomicBoolean(true)
4243

4344
init {
44-
// Register the self-reposting callback once, on the UI thread, so the
45-
// callback queues are only ever mutated from the UI thread.
46-
UiThreadUtil.runOnUiThread { postCallback() }
45+
if (ReactNativeFeatureFlags.useSharedAnimatedBackend()) {
46+
// Register the self-reposting callback once, on the UI thread, so the
47+
// callback queues are only ever mutated from the UI thread.
48+
UiThreadUtil.runOnUiThread { postCallback() }
49+
}
4750
}
4851

4952
fun resume() {

0 commit comments

Comments
 (0)