Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove didMountComponentsWithRootTag on the new arch #2687

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions apple/RNGestureHandlerModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTBridge+Private.h>
#import <React/RCTBridge.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTUtils.h>
#import <ReactCommon/CallInvoker.h>
#import <ReactCommon/RCTTurboModule.h>
Expand All @@ -34,7 +33,7 @@
#endif // RCT_NEW_ARCH_ENABLED

#ifdef RCT_NEW_ARCH_ENABLED
@interface RNGestureHandlerModule () <RCTSurfacePresenterObserver, RNGestureHandlerStateManager>
@interface RNGestureHandlerModule () <RNGestureHandlerStateManager>

@end
#else
Expand Down Expand Up @@ -68,9 +67,7 @@ - (void)invalidate

_manager = nil;

#ifdef RCT_NEW_ARCH_ENABLED
[self.bridge.surfacePresenter removeObserver:self];
#else
#ifndef RCT_NEW_ARCH_ENABLED
[self.bridge.uiManager.observerCoordinator removeObserver:self];
#endif // RCT_NEW_ARCH_ENABLED
}
Expand Down Expand Up @@ -115,9 +112,7 @@ - (void)setBridge:(RCTBridge *)bridge
eventDispatcher:bridge.eventDispatcher];
_operations = [NSMutableArray new];

#ifdef RCT_NEW_ARCH_ENABLED
[bridge.surfacePresenter addObserver:self];
#else
#ifndef RCT_NEW_ARCH_ENABLED
[bridge.uiManager.observerCoordinator addObserver:self];
#endif // RCT_NEW_ARCH_ENABLED
}
Expand Down Expand Up @@ -243,27 +238,7 @@ - (void)addOperationBlock:(GestureHandlerOperation)operation
[_operations addObject:operation];
}

#pragma mark - RCTSurfacePresenterObserver

#ifdef RCT_NEW_ARCH_ENABLED

- (void)didMountComponentsWithRootTag:(NSInteger)rootTag
{
RCTAssertMainQueue();

if (_operations.count == 0) {
return;
}

NSArray<GestureHandlerOperation> *operations = _operations;
_operations = [NSMutableArray new];

for (GestureHandlerOperation operation in operations) {
operation(self->_manager);
}
}

#else
#ifndef RCT_NEW_ARCH_ENABLED

#pragma mark - RCTUIManagerObserver

Expand Down
Loading