Don't log for unavailable modules during reload

Summary:
Removes logging for known invalid states.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D18966536

fbshipit-source-id: 483dce1d2bf0c6c92458f618789cf98dcf92ee97
This commit is contained in:
Rick Hanlon
2020-01-29 04:33:04 -08:00
committed by Facebook Github Bot
parent 947a5593ec
commit 2f9d94418d
+7 -4
View File
@@ -485,19 +485,22 @@ struct RCTInstanceCallback : public InstanceCallback {
return moduleData.instance;
}
static NSSet<NSString *> *ignoredModuleLoadFailures = [NSSet setWithArray: @[@"UIManager"]];
// Module may not be loaded yet, so attempt to force load it here.
const BOOL result = [self.delegate respondsToSelector:@selector(bridge:didNotFindModule:)] &&
[self.delegate bridge:self didNotFindModule:moduleName];
if (result) {
// Try again.
moduleData = _moduleDataByName[moduleName];
} else if ([ignoredModuleLoadFailures containsObject: moduleName]) {
RCTLogWarn(@"Unable to find module for %@", moduleName);
#if RCT_DEV
// If the `_moduleDataByName` is nil, it must have been cleared by the reload.
} else if (_moduleDataByName != nil) {
RCTLogError(@"Unable to find module for %@", moduleName);
}
#else
} else {
RCTLogError(@"Unable to find module for %@", moduleName);
}
#endif
return moduleData.instance;
}