1
1
#import " ReactNativeHost.h"
2
2
3
+ // clang-format off
3
4
#include " FollyConfig.h"
5
+ // clang-format on
4
6
5
7
#import < React/RCTBridge.h>
6
8
#import < React/RCTBundleURLProvider.h>
@@ -27,6 +29,11 @@ @interface ReactNativeHost () <RCTCxxBridgeDelegate>
27
29
#endif // USE_BRIDGELESS
28
30
@end
29
31
32
+ #ifdef USE_CODEGEN_PROVIDER
33
+ @interface ReactNativeHost () <RCTComponentViewFactoryComponentProvider>
34
+ @end
35
+ #endif // USE_CODEGEN_PROVIDER
36
+
30
37
@implementation ReactNativeHost {
31
38
__weak id <RNXHostConfig> _config;
32
39
NSDictionary *_launchOptions;
@@ -59,6 +66,11 @@ - (instancetype)initWithConfig:(id<RNXHostConfig>)config launchOptions:(NSDictio
59
66
_hostReleaser = [[RNXHostReleaser alloc ] initWithHost: self ];
60
67
}
61
68
69
+ #ifdef USE_CODEGEN_PROVIDER
70
+ [RCTComponentViewFactory currentComponentViewFactory ].thirdPartyFabricComponentsProvider =
71
+ self;
72
+ #endif // USE_CODEGEN_PROVIDER
73
+
62
74
#ifdef USE_FEATURE_FLAGS
63
75
if (self.isBridgelessEnabled ) {
64
76
facebook::react::ReactNativeFeatureFlags::override (
@@ -224,6 +236,15 @@ - (void)didCreateContextContainer:
224
236
225
237
#endif // USE_BRIDGELESS
226
238
239
+ // MARK: - RCTComponentViewFactoryComponentProvider details
240
+
241
+ #ifdef USE_CODEGEN_PROVIDER
242
+ - (NSDictionary <NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
243
+ {
244
+ return [RCTThirdPartyComponentsProvider thirdPartyFabricComponents ];
245
+ }
246
+ #endif // USE_CODEGEN_PROVIDER
247
+
227
248
// MARK: - Private
228
249
229
250
- (BOOL )isBridgelessEnabled
@@ -274,7 +295,7 @@ - (void)initializeReactHost
274
295
#else
275
296
return std::make_shared<facebook::react::RCTHermesInstance>(nullptr , false );
276
297
#endif // USE_REACT_NATIVE_CONFIG
277
- #else // USE_HERMES
298
+ #else // USE_HERMES
278
299
return std::make_shared<facebook::react::RCTJscInstance>();
279
300
#endif // USE_HERMES
280
301
};
0 commit comments