Skip to content

Commit

Permalink
Update RNGestureHandlerPackage to supported stable API (#3228)
Browse files Browse the repository at this point in the history
## Summary

Replace the deprecated `TurboReactPackage` with the newer
`BaseReactPackage` to improve compatibility with future React Native
releases. Note that this change requires at least [email protected]+.

Similar change has been introduced in the SVG package
software-mansion/react-native-svg#2541

## Test plan

CI should pass
  • Loading branch information
jakex7 authored Nov 29, 2024
1 parent fe66fe1 commit bf55fde
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.swmansion.gesturehandler

import com.facebook.react.TurboReactPackage
import com.facebook.react.BaseReactPackage
import com.facebook.react.ViewManagerOnDemandReactPackage
import com.facebook.react.bridge.ModuleSpec
import com.facebook.react.bridge.NativeModule
Expand All @@ -19,7 +19,7 @@ import com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager
RNGestureHandlerModule::class
]
)
class RNGestureHandlerPackage : TurboReactPackage(), ViewManagerOnDemandReactPackage {
class RNGestureHandlerPackage : BaseReactPackage(), ViewManagerOnDemandReactPackage {
private val viewManagers: Map<String, ModuleSpec> by lazy {
mapOf(
RNGestureHandlerRootViewManager.REACT_CLASS to ModuleSpec.viewManagerSpec {
Expand Down Expand Up @@ -71,7 +71,6 @@ class RNGestureHandlerPackage : TurboReactPackage(), ViewManagerOnDemandReactPac
RNGestureHandlerModule::class.java.name,
reactModule.canOverrideExistingModule,
reactModule.needsEagerInit,
true, // Has constants is hardcoded to return true, so replacing it with `true` changes nothing.
reactModule.isCxxModule,
true
)
Expand Down

0 comments on commit bf55fde

Please sign in to comment.