Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ Scheduler::Scheduler(
auto uiManager =
std::make_shared<UIManager>(runtimeExecutor_, contextContainer_);

if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
auto animationBackend = std::make_shared<AnimationBackend>(
schedulerToolbox.animationChoreographer, uiManager);

schedulerToolbox.animationChoreographer->setAnimationBackend(
animationBackend);

uiManager->unstable_setAnimationBackend(animationBackend);
}

auto eventOwnerBox = std::make_shared<EventBeat::OwnerBox>();
eventOwnerBox->owner = eventDispatcher_;

Expand Down Expand Up @@ -131,6 +121,19 @@ Scheduler::Scheduler(
uiManager->setDelegate(this);
uiManager->setComponentDescriptorRegistry(componentDescriptorRegistry_);

// Must come after `setDelegate`: the backend's constructor registers a
// surface-start callback, and `UIManager` silently drops those while it has
// no delegate.
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
auto animationBackend = std::make_shared<AnimationBackend>(
schedulerToolbox.animationChoreographer, uiManager);

schedulerToolbox.animationChoreographer->setAnimationBackend(
animationBackend);

uiManager->unstable_setAnimationBackend(animationBackend);
}

auto bindingsExecutor =
schedulerToolbox.bridgelessBindingsExecutor.has_value()
? schedulerToolbox.bridgelessBindingsExecutor.value()
Expand Down
Loading