Skip to content

Commit 244eb42

Browse files
alanleedevfacebook-github-bot
authored andcommitted
add back @deprecated in ViewUtil (#44011)
Summary: Pull Request resolved: #44011 Add back `Deprecated` annotation which was removed in D55651762 Changelog: [Internal] internal Reviewed By: javache Differential Revision: D55955345 fbshipit-source-id: bc255983a57fa01e63b17400079cf4215de9a41f
1 parent 80aa714 commit 244eb42

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public object ViewUtil {
3131
* @param viewTag tag of the view this is event is dispatched to
3232
* @param surfaceId ID of the corresponding surface
3333
*/
34+
@Suppress("DEPRECATION")
3435
@JvmStatic
3536
@UIManagerType
3637
public fun getUIManagerType(viewTag: Int, surfaceId: Int): Int {
@@ -59,5 +60,10 @@ public object ViewUtil {
5960
* @param viewTag react tag
6061
* @return if the react tag received by parameter is a RootTag or not.
6162
*/
62-
@JvmStatic public fun isRootTag(viewTag: Int): Boolean = viewTag % 10 == 1
63+
@Deprecated(
64+
"You should not check the tag of the view to inspect if it's the rootTag. " +
65+
"Relying on this logic could make your app/library break in the future.",
66+
ReplaceWith(""))
67+
@JvmStatic
68+
public fun isRootTag(viewTag: Int): Boolean = viewTag % 10 == 1
6369
}

0 commit comments

Comments
 (0)