From acbf9e18ea666b07c1224a324602a41d0a66985e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 6 Mar 2020 13:25:06 -0800 Subject: [PATCH] Deprecate method UIManagerModule.resolveRootTagFromReactTag Summary: In this diff I'm doing the following: - Deprecating the method UIManagerModule.resolveRootTagFromReactTag - Removing the callsites to the method UIManagerModule.resolveRootTagFromReactTag - Refactoring the callsites in order to keep the same behavior for rootTags - Throwing an exception if this method was being called with a non rootTag - Controlling this change of behavior with a MC This is possible because long time ago we refactored all the callsites to this method to ensure we only use rootTag. I'm making extra steps to make sure this deprecation is safe and we don't break production if this method was being called with a non Root Tag. changelog: [Android][Deprecated] We are deprecating the method UIManagerModule.resolveRootTagFromReactTag, this will not be supported in the next version of RN Reviewed By: fkgozali Differential Revision: D20309166 fbshipit-source-id: 8b89ba889313ae03ed543f402b68f1bb4064ca68 --- .../java/com/facebook/react/uimanager/UIManagerModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index ead772e484d890..0c50f3b5810a2b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -867,9 +867,13 @@ public void removeUIManagerListener(UIManagerModuleListener listener) { * Given a reactTag from a component, find its root node tag, if possible. Otherwise, this will * return 0. If the reactTag belongs to a root node, this will return the same reactTag. * + * @deprecated this method is not going to be supported in the near future, use {@link + * ViewUtil#isRootTag(int)} to verify if a react Tag is a root or not + *

TODO: T63569137 Delete the method UIManagerModule.resolveRootTagFromReactTag * @param reactTag the component tag * @return the rootTag */ + @Deprecated public int resolveRootTagFromReactTag(int reactTag) { return ViewUtil.isRootTag(reactTag) ? reactTag