Skip to content

Commit

Permalink
Undo a breaking change with ResourceDrawableIdHelper.instance (#45389)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #45389

This undos a breaking change with ResourceDrawableIdHelper for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.

Changelog:
[Android] [Fixed] - Undo a breaking change with ResourceDrawableIdHelper.instance

Reviewed By: robhogan

Differential Revision: D59638043

fbshipit-source-id: ae2aab962e9a7676f0bfbae21f699e274502dc6a
  • Loading branch information
cortinico authored and facebook-github-bot committed Jul 11, 2024
1 parent 221755c commit 3f83409
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -6466,6 +6466,7 @@ public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper
}

public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper$Companion {
public final fun DEPRECATED$getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
public final fun getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ public class ResourceDrawableIdHelper private constructor() {
@JvmStatic
public val instance: ResourceDrawableIdHelper
get() = resourceDrawableIdHelper

/**
* We're just re-adding this to reduce a breaking change for libraries in React Native 0.75.
*
* @deprecated Use instance instead
*/
@Deprecated("Use .instance instead, this API is for backward compat", ReplaceWith("instance"))
@JvmName(
"DEPRECATED\$getInstance") // We intentionally don't want to expose this accessor to Java.
public fun getInstance(): ResourceDrawableIdHelper = instance
}
}

0 comments on commit 3f83409

Please sign in to comment.