FBiOS TM: make sure to lazily load view managers

Summary: The hacks we added for lazy viewmanagers don't really apply to TurboModule lookup system, so let's enable lazy lookup as needed only if TurboModule is enabled.

Reviewed By: PeteTheHeat

Differential Revision: D14116548

fbshipit-source-id: 701e963ef0593cd890198725f8cb6d0d29434cd9
This commit is contained in:
Kevin Gozali 2019-02-15 20:11:50 -08:00 коммит произвёл Facebook Github Bot
Родитель a1b3421d10
Коммит 24894ac795
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -1534,13 +1534,13 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView:(NSString *)name)
return @{}; return @{};
} }
id module = [self.bridge moduleForName:moduleName]; id module = [self.bridge moduleForName:moduleName lazilyLoadIfNecessary:RCTTurboModuleEnabled()];
if (module == nil) { if (module == nil) {
// There is all sorts of code in this codebase that drops prefixes. // There is all sorts of code in this codebase that drops prefixes.
// //
// If we didn't find a module, it's possible because it's stored under a key // If we didn't find a module, it's possible because it's stored under a key
// which had RCT Prefixes stripped. Lets check one more time... // which had RCT Prefixes stripped. Lets check one more time...
module = [self.bridge moduleForName:RCTDropReactPrefixes(moduleName)]; module = [self.bridge moduleForName:RCTDropReactPrefixes(moduleName) lazilyLoadIfNecessary:RCTTurboModuleEnabled()];
} }
if (!module) { if (!module) {