Skip to content

Commit 6076a41

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Fabric: Fixes LayoutConformanceView not work (#48253)
Summary: Fixes iOS LayoutConformanceView not work, seems caused by #48188. NickGerleman can you help to review please? ## Changelog: [IOS] [FIXED] - Fabric: Fixes LayoutConformanceView not work Pull Request resolved: #48253 Test Plan: Before: ![image](https://github.com/user-attachments/assets/ca1f12c1-825b-4167-849d-b88f8ec54e21) After: ![image](https://github.com/user-attachments/assets/c81b3192-8552-4147-b3af-3a8920a91d6c) Reviewed By: NickGerleman, cipolleschi Differential Revision: D67195461 Pulled By: javache fbshipit-source-id: 2f45d9a9aa2389ba7cb89e601e7225dbef4f7abf
1 parent 5edd32b commit 6076a41

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#import <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
2020
#import <react/renderer/componentregistry/componentNameByReactViewName.h>
2121
#import <react/renderer/componentregistry/native/NativeComponentRegistryBinding.h>
22+
#import <react/renderer/components/view/LayoutConformanceComponentDescriptor.h>
2223
#import <react/renderer/core/PropsParserContext.h>
2324
#import <react/renderer/core/ReactPrimitives.h>
2425

@@ -75,6 +76,8 @@ + (RCTComponentViewFactory *)currentComponentViewFactory
7576
componentViewFactory = [RCTComponentViewFactory new];
7677
[componentViewFactory registerComponentViewClass:[RCTRootComponentView class]];
7778
[componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]];
79+
componentViewFactory->_providerRegistry.add(
80+
concreteComponentDescriptorProvider<LayoutConformanceComponentDescriptor>());
7881

7982
componentViewFactory->_providerRegistry.setComponentDescriptorProviderRequest(
8083
[](ComponentName requestedComponentName) {

packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ namespace facebook::react {
1616
constexpr const char LayoutConformanceShadowNodeComponentName[] =
1717
"LayoutConformance";
1818

19-
using LayoutConformanceShadowNode = ConcreteShadowNode<
20-
LayoutConformanceShadowNodeComponentName,
21-
YogaLayoutableShadowNode,
22-
LayoutConformanceProps>;
19+
class LayoutConformanceShadowNode final
20+
: public ConcreteShadowNode<
21+
LayoutConformanceShadowNodeComponentName,
22+
YogaLayoutableShadowNode,
23+
LayoutConformanceProps> {
24+
public:
25+
using ConcreteShadowNode::ConcreteShadowNode;
26+
};
2327

2428
} // namespace facebook::react

0 commit comments

Comments
 (0)