@@ -1463,10 +1463,12 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
14631463 }];
14641464}
14651465
1466- static NSMutableDictionary <NSString *, id > *moduleConstantsForComponent (
1466+ NSMutableDictionary <NSString *, id > *RCTModuleConstantsForDestructuredComponent (
14671467 NSMutableDictionary <NSString *, NSDictionary *> *directEvents,
14681468 NSMutableDictionary <NSString *, NSDictionary *> *bubblingEvents,
1469- RCTComponentData *componentData)
1469+ Class managerClass,
1470+ NSString *name,
1471+ NSDictionary <NSString *, id > *viewConfig)
14701472{
14711473 NSMutableDictionary <NSString *, id > *moduleConstants = [NSMutableDictionary new ];
14721474
@@ -1476,10 +1478,9 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
14761478 NSMutableDictionary <NSString *, NSDictionary *> *directEventTypes = [NSMutableDictionary new ];
14771479
14781480 // Add manager class
1479- moduleConstants[@" Manager" ] = RCTBridgeModuleNameForClass (componentData. managerClass );
1481+ moduleConstants[@" Manager" ] = RCTBridgeModuleNameForClass (managerClass);
14801482
14811483 // Add native props
1482- NSDictionary <NSString *, id > *viewConfig = [componentData viewConfig ];
14831484 moduleConstants[@" NativeProps" ] = viewConfig[@" propTypes" ];
14841485 moduleConstants[@" baseModuleName" ] = viewConfig[@" baseModuleName" ];
14851486 moduleConstants[@" bubblingEventTypes" ] = bubblingEventTypes;
@@ -1497,7 +1498,7 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
14971498 RCTLogError (
14981499 @" Component '%@ ' re-registered bubbling event '%@ ' as a "
14991500 " direct event" ,
1500- componentData. name ,
1501+ name,
15011502 eventName);
15021503 }
15031504 }
@@ -1518,7 +1519,7 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
15181519 RCTLogError (
15191520 @" Component '%@ ' re-registered direct event '%@ ' as a "
15201521 " bubbling event" ,
1521- componentData. name ,
1522+ name,
15221523 eventName);
15231524 }
15241525 }
@@ -1540,14 +1541,23 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
15401541 RCTLogError (
15411542 @" Component '%@ ' re-registered direct event '%@ ' as a "
15421543 " bubbling event" ,
1543- componentData. name ,
1544+ name,
15441545 eventName);
15451546 }
15461547 }
15471548
15481549 return moduleConstants;
15491550}
15501551
1552+ static NSMutableDictionary <NSString *, id > *moduleConstantsForComponentData (
1553+ NSMutableDictionary <NSString *, NSDictionary *> *directEvents,
1554+ NSMutableDictionary <NSString *, NSDictionary *> *bubblingEvents,
1555+ RCTComponentData *componentData)
1556+ {
1557+ return RCTModuleConstantsForDestructuredComponent (
1558+ directEvents, bubblingEvents, componentData.managerClass , componentData.name , componentData.viewConfig );
1559+ }
1560+
15511561- (NSDictionary <NSString *, id> *)constantsToExport
15521562{
15531563 return [self getConstants ];
@@ -1563,7 +1573,7 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
15631573 enumerateKeysAndObjectsUsingBlock: ^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {
15641574 RCTAssert (!constants[name], @" UIManager already has constants for %@ " , componentData.name );
15651575 NSMutableDictionary <NSString *, id > *moduleConstants =
1566- moduleConstantsForComponent (directEvents, bubblingEvents, componentData);
1576+ moduleConstantsForComponentData (directEvents, bubblingEvents, componentData);
15671577 constants[name] = moduleConstants;
15681578 }];
15691579
@@ -1611,7 +1621,7 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
16111621 NSMutableDictionary *directEvents = [NSMutableDictionary new ];
16121622 NSMutableDictionary *bubblingEvents = [NSMutableDictionary new ];
16131623 NSMutableDictionary <NSString *, id > *moduleConstants =
1614- moduleConstantsForComponent (directEvents, bubblingEvents, componentData);
1624+ moduleConstantsForComponentData (directEvents, bubblingEvents, componentData);
16151625 return @{
16161626 @" viewConfig" : moduleConstants,
16171627 };
0 commit comments