From e23c3de6bb6befebdc625cb2abbfc7b7881832f2 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Fri, 13 Dec 2024 16:37:16 +0800 Subject: [PATCH] [iOS] Fabric: Fixes LayoutConformanceView not work --- .../React/Fabric/Mounting/RCTComponentViewFactory.mm | 3 +++ .../components/view/LayoutConformanceShadowNode.h | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm b/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm index 97bf3b3b42cfd7..df24eebb9dffa8 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm +++ b/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -19,6 +19,7 @@ #import #import #import +#import #import #import @@ -75,6 +76,8 @@ + (RCTComponentViewFactory *)currentComponentViewFactory componentViewFactory = [RCTComponentViewFactory new]; [componentViewFactory registerComponentViewClass:[RCTRootComponentView class]]; [componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]]; + componentViewFactory->_providerRegistry.add( + concreteComponentDescriptorProvider()); componentViewFactory->_providerRegistry.setComponentDescriptorProviderRequest( [](ComponentName requestedComponentName) { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h index a98acb21f0aaa2..6fc9eb5dea38a3 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h @@ -16,9 +16,13 @@ namespace facebook::react { constexpr const char LayoutConformanceShadowNodeComponentName[] = "LayoutConformance"; -using LayoutConformanceShadowNode = ConcreteShadowNode< - LayoutConformanceShadowNodeComponentName, - YogaLayoutableShadowNode, - LayoutConformanceProps>; +class LayoutConformanceShadowNode final + : public ConcreteShadowNode< + LayoutConformanceShadowNodeComponentName, + YogaLayoutableShadowNode, + LayoutConformanceProps> { + public: + using ConcreteShadowNode::ConcreteShadowNode; +}; } // namespace facebook::react