-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Missing infoMissing reproPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidPlatform: WebPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS
Description
@haibert Unfortunately, that's not possible at the moment. I know it's not an ideal replacement, but you could use state instead of shared value to accomplish a similar effect.
Originally posted by @j-piasecki in #2052 (comment)
DESCRIPTION
is it possible to add the ability to do this with the new API?
USED TO WORK
panGestureHandlerRef.current?.setNativeProps({
activeOffsetX: [-999, 0.1],
failOffsetX: [-0.1, 999],
})
I DONT THINK THIS WORKS ?
const activeOffsetX = useSharedValue([])
const failOffsetX = useSharedValue([])
const lockScrollable = () => {
activeOffsetX.value = [-999, 0.1]
failOffsetX.value = [-0.1, 999]
}
const gesture = Gesture.Pan()
.activeOffsetX(activeOffsetX.value)
.failOffsetX(failOffsetX.value)
.withRef(panGestureHandlerRef)
.simultaneousWithExternalGesture(cardGestureHandlerRef)Platforms
- iOS
- Android
- Web
Steps To Reproduce
https://gist.github.com/haibert/c99861f8c02e7e0b701c83ff2b2317ff
Expected behavior
I want to change the configuration of the gesture imperatively on the fly.
Actual behavior
this functionality does not exist
Snack or minimal code example
https://gist.github.com/haibert/c99861f8c02e7e0b701c83ff2b2317ff
Package versions
"react-native-gesture-handler": "2.4",
"@react-navigation/stack": "^6.2.1",
"react-native-reanimated": "~2.8.0",
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Missing infoMissing reproPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidPlatform: WebPlatform: iOSThis issue is specific to iOSThis issue is specific to iOS