Add FBGroupsLandingView to LegacyViewManagerInterop whitelist

Summary:
Allow components outside of React-Native core to be registered with LegacyViewManagerInterop

changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D17912238

fbshipit-source-id: 67a9109c427c5e3efb8ebb6c6f8c13c2931461a3
This commit is contained in:
Samuel Susla authored and Facebook Github Bot committed 2019-10-31 14:42:47 -07:00
1 parent afd836957f
commit 19f58f4935
3 files changed
+23 -5

No files matched your search

@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (BOOL)isSupported:(NSString *)componentName;
+ (void)supportLegacyViewManagerWithName:(NSString *)componentName;
@end
NS_ASSUME_NONNULL_END
@@ -36,11 +36,21 @@ using namespace facebook::react;
return self;
}
+ (NSMutableSet<NSString *> *)supportedViewManagers
{
static NSMutableSet<NSString *> *supported =
[NSMutableSet setWithObjects:@"Picker", @"DatePicker", @"ProgressView", @"SegmentedControl", @"MaskedView", nil];
return supported;
}
+ (BOOL)isSupported:(NSString *)componentName
{
static NSSet<NSString *> *supportedComponents =
[NSSet setWithObjects:@"Picker", @"DatePicker", @"ProgressView", @"SegmentedControl", @"MaskedView", nil];
return [supportedComponents containsObject:componentName];
return [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
}
+ (void)supportLegacyViewManagerWithName:(NSString *)componentName
{
[[RCTLegacyViewManagerInteropComponentView supportedViewManagers] addObject:componentName];
}
- (RCTLegacyViewManagerInteropCoordinator *)coordinator
@@ -17,9 +17,15 @@
namespace facebook {
namespace react {
static std::string moduleNameFromComponentName(const std::string &componentName)
static std::string moduleNameFromComponentName(const std::string &moduleName)
{
return "RCT" + componentName + "Manager";
// TODO: remove FB specific code (T56174424)
std::string fbPrefix("FB");
if (std::mismatch(fbPrefix.begin(), fbPrefix.end(), moduleName.begin()).first == fbPrefix.end()) {
// If `moduleName` has "FB" prefix.
return moduleName + "Manager";
}
return "RCT" + moduleName + "Manager";
}
inline NSString *RCTNSStringFromString(const std::string &string)