diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index 15a593d56..7c65f1c6f 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -27,7 +27,7 @@ public: [scheduler.delegate schedulerDidFinishTransaction:mutations rootTag:rootTag]; } - void schedulerDidRequestPreliminaryViewAllocation(SurfaceId surfaceId, ComponentName componentName) override { + void schedulerDidRequestPreliminaryViewAllocation(SurfaceId surfaceId, ComponentName componentName, bool isLayoutable, ComponentHandle componentHandle) override { RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_; [scheduler.delegate schedulerDidRequestPreliminaryViewAllocationWithComponentName:RCTNSStringFromString(componentName, NSASCIIStringEncoding)]; } diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index d8320996a..6ad5d946c 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -185,8 +185,15 @@ void Scheduler::uiManagerDidFinishTransaction( void Scheduler::uiManagerDidCreateShadowNode( const SharedShadowNode &shadowNode) { if (delegate_) { + auto layoutableShadowNode = + dynamic_cast(shadowNode.get()); + auto isLayoutable = layoutableShadowNode != nullptr; + delegate_->schedulerDidRequestPreliminaryViewAllocation( - shadowNode->getRootTag(), shadowNode->getComponentName()); + shadowNode->getRootTag(), + shadowNode->getComponentName(), + isLayoutable, + shadowNode->getComponentHandle()); } } diff --git a/ReactCommon/fabric/uimanager/SchedulerDelegate.h b/ReactCommon/fabric/uimanager/SchedulerDelegate.h index 446fb5fb0..821533329 100644 --- a/ReactCommon/fabric/uimanager/SchedulerDelegate.h +++ b/ReactCommon/fabric/uimanager/SchedulerDelegate.h @@ -33,7 +33,9 @@ class SchedulerDelegate { */ virtual void schedulerDidRequestPreliminaryViewAllocation( SurfaceId surfaceId, - ComponentName componentName) = 0; + ComponentName componentName, + bool isLayoutable, + ComponentHandle componentHandle) = 0; virtual ~SchedulerDelegate() noexcept = default; };