mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Removed duplicate UIManager constants
Summary: public We were calling constantsToExport twice for every ViewManager, and including two copies of the values in __fbBatchedBridgeConfig. This diff removes the copy from UIManager and then puts it back on the JS side. Reviewed By: tadeuzagallo Differential Revision: D2665625 fb-gh-sync-id: 147ec4bfb404835e3875964476ba233d619c28aa
This commit is contained in:
committed by
facebook-github-bot-7
parent
32c19c1994
commit
ca20d710fc
@@ -1197,14 +1197,8 @@ RCT_EXPORT_METHOD(clearJSResponder)
|
||||
NSMutableDictionary<NSString *, id> *constantsNamespace =
|
||||
[NSMutableDictionary dictionaryWithDictionary:allJSConstants[name]];
|
||||
|
||||
// Add custom constants
|
||||
// TODO: should these be inherited?
|
||||
NSDictionary<NSString *, id> *constants = RCTClassOverridesInstanceMethod([manager class], @selector(constantsToExport)) ? [manager constantsToExport] : nil;
|
||||
if (constants.count) {
|
||||
RCTAssert(constantsNamespace[@"Constants"] == nil , @"Cannot redefine Constants in namespace: %@", name);
|
||||
// add an additional 'Constants' namespace for each class
|
||||
constantsNamespace[@"Constants"] = constants;
|
||||
}
|
||||
// Add manager class
|
||||
constantsNamespace[@"Manager"] = RCTBridgeModuleNameForClass([manager class]);
|
||||
|
||||
// Add native props
|
||||
NSDictionary<NSString *, id> *viewConfig = [componentData viewConfig];
|
||||
|
||||
Reference in New Issue
Block a user