Skip to content

Commit

Permalink
feat: Use BaseReactPackage instead of TurboReactPackage (#558)
Browse files Browse the repository at this point in the history
This is required for RN 0.77 apparently. TurboReactPackage is deprecated on new arch. No idea why.

I am not sure about backwards compatibility either, sorry.

Feel free to close this PR if this isn't backwards compatible.
  • Loading branch information
mrousavy authored Dec 3, 2024
1 parent abe1513 commit 018f7de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.th3rdwave.safeareacontext

import com.facebook.react.TurboReactPackage
import com.facebook.react.BaseReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.uimanager.ViewManager

// Fool autolinking for older versions that do not support TurboReactPackage.
// Fool autolinking for older versions that do not support BaseReactPackage.
// public class SafeAreaContextPackage implements ReactPackage {
class SafeAreaContextPackage : TurboReactPackage() {
class SafeAreaContextPackage : BaseReactPackage() {
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
return when (name) {
SafeAreaContextModule.NAME -> SafeAreaContextModule(reactContext)
Expand Down

0 comments on commit 018f7de

Please sign in to comment.