From ef17880fb0ae27ce55bbb66eb2d68eab08ba5d41 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 16 May 2025 16:46:37 -0700 Subject: [PATCH] remove return value from synchronouslyUpdateViewOnUIThread (#51402) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51402 changelog: [internal] the return value is unused. Let's remove it. Reviewed By: zeyap Differential Revision: D74884875 fbshipit-source-id: 83449ea298bdfbd7d083080aaa4d214bf246fcab --- packages/react-native/React/Fabric/RCTSurfacePresenter.h | 2 +- .../react-native/React/Fabric/RCTSurfacePresenter.mm | 9 ++++----- .../react-native/React/Modules/RCTSurfacePresenterStub.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/react-native/React/Fabric/RCTSurfacePresenter.h b/packages/react-native/React/Fabric/RCTSurfacePresenter.h index 7c28b377362..f6bc2cc4d0a 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePresenter.h +++ b/packages/react-native/React/Fabric/RCTSurfacePresenter.h @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN - (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag; -- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; +- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; - (void)setupAnimationDriverWithSurfaceHandler:(const facebook::react::SurfaceHandler &)surfaceHandler; diff --git a/packages/react-native/React/Fabric/RCTSurfacePresenter.mm b/packages/react-native/React/Fabric/RCTSurfacePresenter.mm index ad1abd5ec24..48f9410a8ca 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePresenter.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePresenter.mm @@ -148,28 +148,27 @@ using namespace facebook::react; return componentView; } -- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props +- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props { RCTScheduler *scheduler = [self scheduler]; if (!scheduler) { - return NO; + return; } ReactTag tag = [reactTag integerValue]; UIView *componentView = [_mountingManager.componentViewRegistry findComponentViewWithTag:tag]; if (componentView == nil) { - return NO; // This view probably isn't managed by Fabric + return; // This view probably isn't managed by Fabric } ComponentHandle handle = [[componentView class] componentDescriptorProvider].handle; auto *componentDescriptor = [scheduler findComponentDescriptorByHandle_DO_NOT_USE_THIS_IS_BROKEN:handle]; if (!componentDescriptor) { - return YES; + return; } [_mountingManager synchronouslyUpdateViewOnUIThread:tag changedProps:props componentDescriptor:*componentDescriptor]; - return YES; } - (void)setupAnimationDriverWithSurfaceHandler:(const facebook::react::SurfaceHandler &)surfaceHandler diff --git a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h index 9cf33485474..aea607083a0 100644 --- a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h +++ b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN - (id)createFabricSurfaceForModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties; - (nullable UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; -- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; +- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; - (void)addObserver:(id)observer; - (void)removeObserver:(id)observer;