File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Fabric/Mounting/ComponentViews/View Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ NS_ASSUME_NONNULL_BEGIN
7979- (void )finalizeUpdates : (RNComponentViewUpdateMask)updateMask NS_REQUIRES_SUPER;
8080- (void )prepareForRecycle NS_REQUIRES_SUPER;
8181
82+ /*
83+ * This is a fragment of temporary workaround that we need only temporary and will get rid of soon.
84+ */
85+ - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN ;
86+
8287@end
8388
8489NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -564,4 +564,9 @@ - (SharedTouchEventEmitter)touchEventEmitterAtPoint:(CGPoint)point
564564 return _eventEmitter;
565565}
566566
567+ - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
568+ {
569+ return RCTNSStringFromString ([[self class ] componentDescriptorProvider ].name );
570+ }
571+
567572@end
Original file line number Diff line number Diff line change @@ -1065,6 +1065,25 @@ - (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag
10651065{
10661066 RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
10671067 RCTComponentData *componentData = _componentDataByName[shadowView.viewName];
1068+
1069+ // Achtung! Achtung!
1070+ // This is a remarkably hacky and ugly workaround.
1071+ // We need this only temporary for some testing. We need this hack until Fabric fully implements command-execution pipeline.
1072+ // This does not affect non-Fabric apps.
1073+ #pragma clang diagnostic push
1074+ #pragma clang diagnostic ignored "-Wundeclared-selector"
1075+ if (!componentData) {
1076+ __block UIView *view;
1077+ RCTUnsafeExecuteOnMainQueueSync (^{
1078+ view = self->_viewRegistry [reactTag];
1079+ });
1080+ if ([view respondsToSelector: @selector (componentViewName_DO_NOT_USE_THIS_IS_BROKEN )]) {
1081+ NSString *name = [view performSelector: @selector (componentViewName_DO_NOT_USE_THIS_IS_BROKEN )];
1082+ componentData = _componentDataByName[[NSString stringWithFormat: @" RCT%@ " , name]];
1083+ }
1084+ }
1085+ #pragma clang diagnostic pop
1086+
10681087 Class managerClass = componentData.managerClass ;
10691088 RCTModuleData *moduleData = [_bridge moduleDataForName: RCTBridgeModuleNameForClass (managerClass)];
10701089 id <RCTBridgeMethod> method = moduleData.methods [commandID];
You can’t perform that action at this time.
0 commit comments