From 6aa63272dcbe4bfbfe21b175ea7fa84708a4ef66 Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Sat, 22 Aug 2020 01:17:11 -0700 Subject: [PATCH] Create internal Fabric subclass of RCTImageComponentView Summary: Changelog: [Internal] Create internal Fabric subclass of RCTImageComponentView Reviewed By: sammy-SC Differential Revision: D23211115 fbshipit-source-id: 0e756de3f3e555bf212dc88dfc8c32930ac85132 --- .../ComponentViews/Image/RCTImageComponentView.mm | 15 ++++++++++++--- .../ComponentViews/RCTFabricComponentsPlugins.h | 1 - .../ComponentViews/RCTFabricComponentsPlugins.mm | 1 - .../ComponentViews/View/RCTViewComponentView.mm | 15 ++++++++++++--- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index fbef56afa10..e617f20b72c 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -7,6 +7,7 @@ #import "RCTImageComponentView.h" +#import #import #import #import @@ -18,9 +19,6 @@ #import #import -#import "RCTConversions.h" -#import "RCTFabricComponentsPlugins.h" - using namespace facebook::react; @interface RCTImageComponentView () @@ -209,6 +207,17 @@ using namespace facebook::react; @end +#ifdef __cplusplus +extern "C" { +#endif + +// Can't the import generated Plugin.h because plugins are not in this BUCK target +Class RCTImageCls(void); + +#ifdef __cplusplus +} +#endif + Class RCTImageCls(void) { return RCTImageComponentView.class; diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h index fa7984df03a..4f6ea0e8156 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h @@ -36,7 +36,6 @@ Class RCTActivityIndicatorViewCls(void) __attribute__( Class RCTSliderCls(void) __attribute__((used)); Class RCTSwitchCls(void) __attribute__((used)); Class RCTUnimplementedNativeViewCls(void) __attribute__((used)); -Class RCTImageCls(void) __attribute__((used)); Class RCTParagraphCls(void) __attribute__((used)); Class RCTTextInputCls(void) __attribute__((used)); Class RCTInputAccessoryCls(void) __attribute__((used)); diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm index c8bee6acfce..a52c8c06e36 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm @@ -25,7 +25,6 @@ Class RCTFabricComponentsProvider(const char *name) { {"Slider", RCTSliderCls}, {"Switch", RCTSwitchCls}, {"UnimplementedNativeView", RCTUnimplementedNativeViewCls}, - {"Image", RCTImageCls}, {"Paragraph", RCTParagraphCls}, {"TextInput", RCTTextInputCls}, {"InputAccessoryView", RCTInputAccessoryCls}, diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 1b6c81c1679..e5c7e6a8537 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -9,14 +9,12 @@ #import #import +#import #import #import #import #import -#import "RCTConversions.h" -#import "RCTFabricComponentsPlugins.h" - using namespace facebook::react; @implementation RCTViewComponentView { @@ -622,6 +620,17 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) @end +#ifdef __cplusplus +extern "C" { +#endif + +// Can't the import generated Plugin.h because plugins are not in this BUCK target +Class RCTViewCls(void); + +#ifdef __cplusplus +} +#endif + Class RCTViewCls(void) { return RCTViewComponentView.class;