Skip to content

Commit 50ec74e

Browse files
okwasniewskifacebook-github-bot
authored andcommitted
fix(iOS): use getNextRootViewTag() on new architecture (#51522)
Summary: Sometime ago Fabric specific root view tag allocator was added to the codebase: 7dec625 This PR makes sure to use it on iOS. It removes the need for additional conversions. ## Changelog: [INTERNAL] [CHANGED] - use getNextRootViewTag() on new architecture Pull Request resolved: #51522 Test Plan: CI Green Reviewed By: javache Differential Revision: D75204499 Pulled By: rshest fbshipit-source-id: 12927887ae229c9fe89fa680f2bd55b5e378f9ae
1 parent d42d463 commit 50ec74e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#import <React/RCTSurfaceView.h>
2222
#import <React/RCTUIManagerUtils.h>
2323
#import <React/RCTUtils.h>
24+
#import <react/renderer/core/ReactRootViewTagGenerator.h>
2425
#import <react/renderer/mounting/MountingCoordinator.h>
2526
#import <react/utils/FollyConvert.h>
2627

@@ -56,8 +57,7 @@ - (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter
5657
if (self = [super init]) {
5758
_surfacePresenter = surfacePresenter;
5859

59-
_surfaceHandler =
60-
SurfaceHandler{RCTStringFromNSString(moduleName), (SurfaceId)[RCTAllocateRootViewTag() integerValue]};
60+
_surfaceHandler = SurfaceHandler{RCTStringFromNSString(moduleName), getNextRootViewTag()};
6161
_surfaceHandler->setProps(convertIdToFollyDynamic(initialProperties));
6262

6363
[_surfacePresenter registerSurface:self];

0 commit comments

Comments
 (0)