Skip to content

Commit

Permalink
fix(web-storage): migrate away from `com.facebook.react.turbomodule.c…
Browse files Browse the repository at this point in the history
…ore.interfaces.TurboModule` (#2989)
  • Loading branch information
tido64 committed Feb 28, 2024
1 parent 0eb1198 commit 22420d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-zebras-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-webapis/web-storage": patch
---

Migrate away from `com.facebook.react.turbomodule.core.interfaces.TurboModule` as it has been moved/renamed in 0.74 and will break TurboModule detection
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.turbomodule.core.interfaces.TurboModule

class WebStoragePackage : TurboReactPackage() {
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule {
Expand All @@ -23,7 +22,7 @@ class WebStoragePackage : TurboReactPackage() {
false,
false,
false,
TurboModule::class.java.isAssignableFrom(WebStorageModule::class.java)
WebStorageModule.IS_TURBO_MODULE
)
mapOf(info.name() to info).toMutableMap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactApplicationContext
class WebStorageModule(context: ReactApplicationContext) : NativeWebStorageSpec(context) {

companion object {
const val IS_TURBO_MODULE = true
const val NAME = NativeWebStorageSpec.NAME
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.facebook.react.bridge.ReactMethod
class WebStorageModule(context: ReactApplicationContext) : ReactContextBaseJavaModule(context) {

companion object {
const val IS_TURBO_MODULE = false
const val NAME = "RNWWebStorage"
}

Expand Down

0 comments on commit 22420d7

Please sign in to comment.