Fix BlobProvider not working in newarch (#56369)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56369

Blob images in RNTester work

Changelog: [Android][Fixed] Blob content provider did not work in new arch

Reviewed By: alanleedev

Differential Revision: D99836114

fbshipit-source-id: e672a920c2327dfe18edaae5291dd8bb8642cdd1
This commit is contained in:
Pieter De Baets authored and meta-codesync[bot] committed 2026-04-09 03:26:04 -07:00
1 parent b20d7fccc8
commit 05ea94c441
1 file changed
+1 -2
@@ -53,9 +53,8 @@ public class BlobProvider : ContentProvider() {
var blobModule: BlobModule? = null
val context = context?.applicationContext
if (context is ReactApplication) {
@Suppress("DEPRECATION") val host = (context as ReactApplication).reactNativeHost
val reactContext =
host.reactInstanceManager.currentReactContext
context.reactHost?.currentReactContext
?: throw RuntimeException("No ReactContext associated with BlobProvider")
blobModule = reactContext.getNativeModule(BlobModule::class.java)
}