Skip to content

Commit c9f8aed

Browse files
Bartlomiej Bloniarzfacebook-github-bot
authored andcommitted
Gate new functionality with the flag
Differential Revision: D81138135
1 parent d7caea4 commit c9f8aed

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ NativeAnimatedNodesManager::NativeAnimatedNodesManager(
8989
LOG(ERROR)
9090
<< "C++ Animated was setup without a way to update UI. Animations will not work.";
9191
}
92-
// shouldn't be initialized here, but it's convenient for now
93-
animationBackend_ = std::make_shared<AnimationBackend>(
94-
startOnRenderCallback_,
95-
stopOnRenderCallback_,
96-
directManipulationCallback_);
92+
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
93+
// shouldn't be initialized here, but it's convenient for now
94+
animationBackend_ = std::make_shared<AnimationBackend>(
95+
startOnRenderCallback_,
96+
stopOnRenderCallback_,
97+
directManipulationCallback_);
98+
}
9799
}
98100

99101
NativeAnimatedNodesManager::~NativeAnimatedNodesManager() noexcept {
@@ -875,6 +877,9 @@ void NativeAnimatedNodesManager::schedulePropsCommit(
875877
}
876878

877879
AnimationMutations NativeAnimatedNodesManager::pullAnimationMutations() {
880+
if (!ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
881+
return {};
882+
}
878883
TraceSection s(
879884
"NativeAnimatedNodesManager::pullAnimations",
880885
"numActiveAnimations",

0 commit comments

Comments
 (0)