Skip to content

Commit

Permalink
Fabric: Fixes LayoutConformanceView not work (#48253)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Dec 16, 2024
1 parent 5edd32b commit 6076a41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#import <react/renderer/componentregistry/componentNameByReactViewName.h>
#import <react/renderer/componentregistry/native/NativeComponentRegistryBinding.h>
#import <react/renderer/components/view/LayoutConformanceComponentDescriptor.h>
#import <react/renderer/core/PropsParserContext.h>
#import <react/renderer/core/ReactPrimitives.h>

Expand Down Expand Up @@ -75,6 +76,8 @@ + (RCTComponentViewFactory *)currentComponentViewFactory
componentViewFactory = [RCTComponentViewFactory new];
[componentViewFactory registerComponentViewClass:[RCTRootComponentView class]];
[componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]];
componentViewFactory->_providerRegistry.add(
concreteComponentDescriptorProvider<LayoutConformanceComponentDescriptor>());

componentViewFactory->_providerRegistry.setComponentDescriptorProviderRequest(
[](ComponentName requestedComponentName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6076a41

Please sign in to comment.