mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Lay groundwork for Fabric iOS plugins
Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D18397243 fbshipit-source-id: bae51800e93259e50db51dac2d9d7b4b52d8ef23
This commit is contained in:
committed by
Facebook Github Bot
parent
75a154b449
commit
d1f0826f2c
@@ -14,6 +14,16 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTComponentViewFactoryDelegate <NSObject>
|
||||
|
||||
/**
|
||||
* Given a component name, return its actual class. If component with doesn't exist, nil is returned.
|
||||
* Can be called on any thread.
|
||||
*/
|
||||
- (Class<RCTComponentViewProtocol>)componentViewClassWithName:(facebook::react::ComponentName)name;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* Registry of supported component view classes that can instantiate
|
||||
* view component instances by given component handle.
|
||||
@@ -42,6 +52,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (facebook::react::ComponentDescriptorRegistry::Shared)createComponentDescriptorRegistryWithParameters:
|
||||
(facebook::react::ComponentDescriptorParameters)parameters;
|
||||
|
||||
@property (atomic, weak, nullable) id<RCTComponentViewFactoryDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -66,8 +66,15 @@ using namespace facebook::react;
|
||||
|
||||
providerRegistry->setComponentDescriptorProviderRequest([providerRegistry,
|
||||
componentViewFactory](ComponentName requestedComponentName) {
|
||||
// Fallback 1: Call the delegate.
|
||||
// To be implemented.
|
||||
// Fallback 1: Call delegate for component view class.
|
||||
if (componentViewFactory.delegate) {
|
||||
Class<RCTComponentViewProtocol> klass =
|
||||
[componentViewFactory.delegate componentViewClassWithName:requestedComponentName];
|
||||
if (klass) {
|
||||
[componentViewFactory registerComponentViewClass:klass];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback 2: Try to use Paper Interop.
|
||||
if ([RCTLegacyViewManagerInteropComponentView isSupported:RCTNSStringFromString(requestedComponentName)]) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#import <React/RCTPrimitives.h>
|
||||
#import <React/RCTSurfacePresenterStub.h>
|
||||
|
||||
#import <React/RCTComponentViewFactory.h>
|
||||
#import <react/utils/ContextContainer.h>
|
||||
#import <react/utils/RuntimeExecutor.h>
|
||||
|
||||
@@ -18,7 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class RCTFabricSurface;
|
||||
@class RCTImageLoader;
|
||||
@class RCTMountingManager;
|
||||
@class RCTComponentViewFactory;
|
||||
|
||||
/**
|
||||
* Coordinates presenting of React Native Surfaces and represents application
|
||||
|
||||
Reference in New Issue
Block a user