From 50ec74e2d5d747be08d18eb0d4f600fe1289c1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Thu, 22 May 2025 07:50:24 -0700 Subject: [PATCH] fix(iOS): use getNextRootViewTag() on new architecture (#51522) Summary: Sometime ago Fabric specific root view tag allocator was added to the codebase: https://github.com/facebook/react-native/commit/7dec625ecabdc23cbae37e0034d29bb7bff17755 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: https://github.com/facebook/react-native/pull/51522 Test Plan: CI Green Reviewed By: javache Differential Revision: D75204499 Pulled By: rshest fbshipit-source-id: 12927887ae229c9fe89fa680f2bd55b5e378f9ae --- .../react-native/React/Fabric/Surface/RCTFabricSurface.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm index 7d6abea1d1b..1382f13e9ac 100644 --- a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm +++ b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm @@ -21,6 +21,7 @@ #import #import #import +#import #import #import @@ -56,8 +57,7 @@ using namespace facebook::react; if (self = [super init]) { _surfacePresenter = surfacePresenter; - _surfaceHandler = - SurfaceHandler{RCTStringFromNSString(moduleName), (SurfaceId)[RCTAllocateRootViewTag() integerValue]}; + _surfaceHandler = SurfaceHandler{RCTStringFromNSString(moduleName), getNextRootViewTag()}; _surfaceHandler->setProps(convertIdToFollyDynamic(initialProperties)); [_surfacePresenter registerSurface:self];