From 244eb42b33cf5f9ed32c757e41ceb5e971e8fad7 Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Wed, 10 Apr 2024 09:43:04 -0700 Subject: [PATCH] add back @Deprecated in ViewUtil (#44011) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44011 Add back `Deprecated` annotation which was removed in D55651762 Changelog: [Internal] internal Reviewed By: javache Differential Revision: D55955345 fbshipit-source-id: bc255983a57fa01e63b17400079cf4215de9a41f --- .../java/com/facebook/react/uimanager/common/ViewUtil.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt index f6bf7ffe18e..bf01340c098 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt @@ -31,6 +31,7 @@ public object ViewUtil { * @param viewTag tag of the view this is event is dispatched to * @param surfaceId ID of the corresponding surface */ + @Suppress("DEPRECATION") @JvmStatic @UIManagerType public fun getUIManagerType(viewTag: Int, surfaceId: Int): Int { @@ -59,5 +60,10 @@ public object ViewUtil { * @param viewTag react tag * @return if the react tag received by parameter is a RootTag or not. */ - @JvmStatic public fun isRootTag(viewTag: Int): Boolean = viewTag % 10 == 1 + @Deprecated( + "You should not check the tag of the view to inspect if it's the rootTag. " + + "Relying on this logic could make your app/library break in the future.", + ReplaceWith("")) + @JvmStatic + public fun isRootTag(viewTag: Int): Boolean = viewTag % 10 == 1 }