diff --git a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js index f626478e4f1b43..e08cc860965ff7 100644 --- a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js +++ b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js @@ -232,9 +232,6 @@ const UIManagerJS: UIManagerJSInterface & {[string]: any} = { ): void => { raiseSoftError('configureNextLayoutAnimation'); }, - removeSubviewsFromContainerWithID: (containerID: number): void => { - raiseSoftError('removeSubviewsFromContainerWithID'); - }, replaceExistingNonRootView: ( reactTag: ?number, newReactTag: ?number, diff --git a/packages/react-native/Libraries/ReactNative/NativeUIManager.js b/packages/react-native/Libraries/ReactNative/NativeUIManager.js index e84ab25be84e3e..160ee4f912d369 100644 --- a/packages/react-native/Libraries/ReactNative/NativeUIManager.js +++ b/packages/react-native/Libraries/ReactNative/NativeUIManager.js @@ -86,7 +86,6 @@ export interface Spec extends TurboModule { callback: () => void, // check what is returned here errorCallback: (error: Object) => void, ) => void; - +removeSubviewsFromContainerWithID: (containerID: number) => void; +replaceExistingNonRootView: ( reactTag: ?number, newReactTag: ?number, diff --git a/packages/react-native/Libraries/ReactNative/UIManagerProperties.js b/packages/react-native/Libraries/ReactNative/UIManagerProperties.js index c332897730a6d9..b8b709e0c76b1c 100644 --- a/packages/react-native/Libraries/ReactNative/UIManagerProperties.js +++ b/packages/react-native/Libraries/ReactNative/UIManagerProperties.js @@ -41,7 +41,6 @@ module.exports = [ 'measureLayout', 'measureLayoutRelativeToParent', 'removeRootView', - 'removeSubviewsFromContainerWithID', 'replaceExistingNonRootView', 'sendAccessibilityEvent', 'setChildren', diff --git a/packages/react-native/React/Modules/RCTUIManager.m b/packages/react-native/React/Modules/RCTUIManager.m index a646f95079db04..fb9c5bc00869ed 100644 --- a/packages/react-native/React/Modules/RCTUIManager.m +++ b/packages/react-native/React/Modules/RCTUIManager.m @@ -700,31 +700,6 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView * }; } -/** - * A method to be called from JS, which takes a container ID and then releases - * all subviews for that container upon receipt. - */ -RCT_EXPORT_METHOD(removeSubviewsFromContainerWithID : (nonnull NSNumber *)containerID) -{ - RCTLogWarn( - @"RCTUIManager.removeSubviewsFromContainerWithID method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450"); - id container = _shadowViewRegistry[containerID]; - RCTAssert(container != nil, @"container view (for ID %@) not found", containerID); - - NSUInteger subviewsCount = [container reactSubviews].count; - NSMutableArray *indices = [[NSMutableArray alloc] initWithCapacity:subviewsCount]; - for (NSUInteger childIndex = 0; childIndex < subviewsCount; childIndex++) { - [indices addObject:@(childIndex)]; - } - - [self manageChildren:containerID - moveFromIndices:nil - moveToIndices:nil - addChildReactTags:nil - addAtIndices:nil - removeAtIndices:indices]; -} - /** * Disassociates children from container. Doesn't remove from registries. * TODO: use [NSArray getObjects:buffer] to reuse same fast buffer each time. diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 440ff3e2b8f8a8..637c935cd0636e 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -4861,7 +4861,6 @@ public class com/facebook/react/uimanager/UIImplementation { public fun removeRootShadowNode (I)V public fun removeRootView (I)V protected final fun removeShadowNode (Lcom/facebook/react/uimanager/ReactShadowNode;)V - public fun removeSubviewsFromContainerWithID (I)V public fun replaceExistingNonRootView (II)V public fun resolveRootTagFromReactTag (I)I public final fun resolveShadowNode (I)Lcom/facebook/react/uimanager/ReactShadowNode; @@ -4949,7 +4948,6 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V public fun removeRootView (I)V - public fun removeSubviewsFromContainerWithID (I)V public fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V public fun removeUIManagerListener (Lcom/facebook/react/uimanager/UIManagerModuleListener;)V public fun replaceExistingNonRootView (II)V @@ -7739,4 +7737,3 @@ public class com/facebook/react/views/view/ViewGroupClickEvent : com/facebook/re protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap; public fun getEventName ()Ljava/lang/String; } - diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java index 894f32380bda2c..1f527f574b7cee 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java @@ -480,27 +480,6 @@ public void replaceExistingNonRootView(int oldTag, int newTag) { manageChildren(parent.getReactTag(), null, null, tagsToAdd, addAtIndices, indicesToRemove); } - /** - * Method which takes a container tag and then releases all subviews for that container upon - * receipt. TODO: The method name is incorrect and will be renamed, #6033872 - * - * @param containerTag the tag of the container for which the subviews must be removed - */ - public void removeSubviewsFromContainerWithID(int containerTag) { - ReactShadowNode containerNode = mShadowNodeRegistry.getNode(containerTag); - if (containerNode == null) { - throw new IllegalViewOperationException( - "Trying to remove subviews of an unknown view tag: " + containerTag); - } - - WritableArray indicesToRemove = Arguments.createArray(); - for (int childIndex = 0; childIndex < containerNode.getChildCount(); childIndex++) { - indicesToRemove.pushInt(childIndex); - } - - manageChildren(containerTag, null, null, null, null, indicesToRemove); - } - /** * Find the touch target child native view in the supplied root view hierarchy, given a react * target location. diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 964a22204f05f7..c5bbd85f047969 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -499,19 +499,6 @@ public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); } - /** - * Method which takes a container tag and then releases all subviews for that container upon - * receipt. - * - * @param containerTag the tag of the container for which the subviews must be removed - * @deprecated This method will not be available in Fabric UIManager class. - */ - @ReactMethod - @Deprecated - public void removeSubviewsFromContainerWithID(int containerTag) { - mUIImplementation.removeSubviewsFromContainerWithID(containerTag); - } - /** * Determines the location on screen, width, and height of the given view and returns the values * via an async callback. diff --git a/packages/react-native/jest/setup.js b/packages/react-native/jest/setup.js index 84aa60d5770254..89931ad3377d5b 100644 --- a/packages/react-native/jest/setup.js +++ b/packages/react-native/jest/setup.js @@ -93,7 +93,6 @@ jest }), measure: jest.fn(), manageChildren: jest.fn(), - removeSubviewsFromContainerWithID: jest.fn(), replaceExistingNonRootView: jest.fn(), setChildren: jest.fn(), updateView: jest.fn(),