From 78e2dc45497b477296f8135c2d2e562996ac59af Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 12 Feb 2026 23:24:00 -0800 Subject: [PATCH] Fix DeadVariable and NotInvokedPrivateMethod: Remove unused code (#55503) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55503 Remove unused code that was triggering lint warnings: 1. Remove `walkUpUntilNativeKindIsParent` private method that was never invoked 2. Remove `parent` variable in `applyLayoutBase` that was never accessed Both were leftover from NativeKind removal. changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D92021031 fbshipit-source-id: 7549efd01ddf167df4a130c255ccf1c8d663e1d2 --- .../react/uimanager/NativeViewHierarchyOptimizer.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java index 8bcbd2adc6d..79f3f6b5db5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java @@ -231,12 +231,6 @@ public class NativeViewHierarchyOptimizer { mTagsWithLayoutVisited.clear(); } - private NodeIndexPair walkUpUntilNativeKindIsParent( - ReactShadowNode node, int indexInNativeChildren) { - // Logic removed due to NativeKind removal - return new NodeIndexPair(node, indexInNativeChildren); - } - private void addNodeToNode(ReactShadowNode parent, ReactShadowNode child, int index) { // Logic removed due to NativeKind removal } @@ -289,8 +283,6 @@ public class NativeViewHierarchyOptimizer { } mTagsWithLayoutVisited.put(tag, true); - ReactShadowNode parent = node.getParent(); - // We use screenX/screenY (which round to integer pixels) at each node in the hierarchy to // emulate what the layout would look like if it were actually built with native views which // have to have integral top/left/bottom/right values