mirror of
https://github.com/status-im/react-native.git
synced 2025-02-20 13:18:07 +00:00
iOS: ignore extra modules during bridge start up if it's marked for TurboModule
Summary: Currently, bridge delegate can provide extra modules during bridge start up path. For TurboModules, we don't need this mechanism (if we need eager init, it will be done in a different way). So, let's ignore modules marked as RCTTurboModule if they are supplied as "extra native modules". Reviewed By: axe-fb Differential Revision: D13383710 fbshipit-source-id: c88d32739be9f66e0daf07ef5465ea6457f8d1c6
This commit is contained in:
parent
33fb70f6b6
commit
2918679479
@ -659,6 +659,16 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||
}
|
||||
}
|
||||
|
||||
if (RCTTurboModuleEnabled() && [module conformsToProtocol:@protocol(RCTTurboModule)]) {
|
||||
#if RCT_DEBUG
|
||||
// TODO: don't ask for extra module for when TurboModule is enabled.
|
||||
RCTLogError(@"NativeModule '%@' was marked as TurboModule, but provided as an extra NativeModule "
|
||||
"by the class '%@', ignoring.",
|
||||
moduleName, moduleClass);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
// Instantiate moduleData container
|
||||
RCTModuleData *moduleData = [[RCTModuleData alloc] initWithModuleInstance:module bridge:self];
|
||||
_moduleDataByName[moduleName] = moduleData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user