mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Minor: Move RCTLogNewArchitectureValidation in RCTLegacyViewManagerInteropComponentView
Summary: Changelog: [Internal][iOS] Reviewed By: fkgozali Differential Revision: D37733640 fbshipit-source-id: cb447ceba2a43fdd9808c80c54af99ff4d31305b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5e23ed699f
commit
b834d5869f
-8
@@ -109,14 +109,6 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
||||
|
||||
+ (BOOL)isSupported:(NSString *)componentName
|
||||
{
|
||||
RCTLogNewArchitectureValidation(
|
||||
RCTNotAllowedInBridgeless,
|
||||
self,
|
||||
[NSString
|
||||
stringWithFormat:
|
||||
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
|
||||
componentName]);
|
||||
|
||||
// Step 1: check if ViewManager with specified name is supported.
|
||||
BOOL isComponentNameSupported =
|
||||
[[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
|
||||
|
||||
@@ -117,7 +117,16 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
|
||||
}
|
||||
|
||||
// Fallback 2: Try to use Paper Interop.
|
||||
if ([RCTLegacyViewManagerInteropComponentView isSupported:RCTNSStringFromString(name)]) {
|
||||
NSString *componentNameString = RCTNSStringFromString(name);
|
||||
if ([RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) {
|
||||
RCTLogNewArchitectureValidation(
|
||||
RCTNotAllowedInBridgeless,
|
||||
self,
|
||||
[NSString
|
||||
stringWithFormat:
|
||||
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
|
||||
componentNameString]);
|
||||
|
||||
auto flavor = std::make_shared<std::string const>(name);
|
||||
auto componentName = ComponentName{flavor->c_str()};
|
||||
auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
|
||||
|
||||
Reference in New Issue
Block a user