Skip to content

Commit

Permalink
Remove gating for legacy interop layer view hierarchy changes
Browse files Browse the repository at this point in the history
Summary: changelog: [internal]

Reviewed By: javache

Differential Revision: D34756141

fbshipit-source-id: f78ee2376d03652813353bfd88c3c349d1c6ae4f
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Mar 11, 2022
1 parent 009d80b commit c9bbe75
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 32 deletions.
6 changes: 0 additions & 6 deletions React/Base/RCTConstants.h
Expand Up @@ -15,9 +15,3 @@ RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollec
*/
RCT_EXTERN BOOL RCTExperimentGetPreemptiveViewAllocationDisabled(void);
RCT_EXTERN void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value);

/*
* Interop layer keep view hierarchy.
*/
RCT_EXTERN BOOL RCTGetInteropLayerKeepViewHierarchy(void);
RCT_EXTERN void RCTSetInteropLayerKeepViewHierarchy(BOOL value);
15 changes: 0 additions & 15 deletions React/Base/RCTConstants.m
Expand Up @@ -24,18 +24,3 @@ void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value)
{
RCTExperimentPreemptiveViewAllocationDisabled = value;
}

/*
* Preemptive View Allocation
*/
static BOOL RCTInteropLayerKeepViewHierarchy = NO;

BOOL RCTGetInteropLayerKeepViewHierarchy()
{
return RCTInteropLayerKeepViewHierarchy;
}

void RCTSetInteropLayerKeepViewHierarchy(BOOL value)
{
RCTInteropLayerKeepViewHierarchy = value;
}
Expand Up @@ -205,13 +205,9 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
for (NSDictionary *mountInstruction in _viewsToBeMounted) {
NSNumber *index = mountInstruction[kRCTLegacyInteropChildIndexKey];
UIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey];
if (RCTGetInteropLayerKeepViewHierarchy()) {
if ([childView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView;
[_adapter.paperView insertReactSubview:target atIndex:index.integerValue];
} else {
[_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
}
if ([childView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView;
[_adapter.paperView insertReactSubview:target atIndex:index.integerValue];
} else {
[_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
}
Expand Down
4 changes: 0 additions & 4 deletions React/Fabric/RCTSurfacePresenter.mm
Expand Up @@ -263,10 +263,6 @@ - (RCTScheduler *)_createScheduler
RCTExperimentSetPreemptiveViewAllocationDisabled(YES);
}

RCTSetInteropLayerKeepViewHierarchy(
reactNativeConfig &&
reactNativeConfig->getBool("react_native_new_architecture:interop_layer_keep_view_hierarchy"));

auto componentRegistryFactory =
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
EventDispatcher::Weak const &eventDispatcher, ContextContainer::Shared const &contextContainer) {
Expand Down

0 comments on commit c9bbe75

Please sign in to comment.