Skip to content

Commit 03a695c

Browse files
committed
//@ts-expect-error - useAnimatedGestureHandler migration
1 parent 7957805 commit 03a695c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/incubator/TouchableOpacity.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ function TouchableOpacity(props: Props) {
132132
}
133133
});
134134

135-
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
136135
const animatedStyle = useAnimatedStyle(() => {
137136
const activeColor = feedbackColor || backgroundColor;
138137
const opacity = interpolate(isActive.value, [0, 1], [1, activeOpacity]);
@@ -151,12 +150,17 @@ function TouchableOpacity(props: Props) {
151150

152151
return (
153152
<TapGestureHandler
153+
//@ts-expect-error
154154
onGestureEvent={tapGestureHandler}
155155
shouldCancelWhenOutside
156156
enabled={!disabled}
157157
>
158158
<Reanimated.View>
159-
<Container onGestureEvent={longPressGestureHandler} shouldCancelWhenOutside>
159+
<Container
160+
//@ts-expect-error
161+
onGestureEvent={longPressGestureHandler}
162+
shouldCancelWhenOutside
163+
>
160164
<Reanimated.View
161165
{...others}
162166
ref={forwardedRef}

src/incubator/panView/usePanGesture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,15 @@ const usePanGesture = (props: PanGestureProps) => {
113113
}, [animateToOrigin]);
114114

115115
const onGestureEvent = useAnimatedGestureHandler({
116+
//@ts-expect-error
116117
onStart: (_event: PanGestureHandlerEventPayload, context: {initialTranslation: Frame}) => {
117118
context.initialTranslation = {x: translationX.value, y: translationY.value};
118119
},
120+
//@ts-expect-error
119121
onActive: (event: PanGestureHandlerEventPayload, context: {initialTranslation: Frame}) => {
120122
setTranslation(event, context.initialTranslation);
121123
},
124+
//@ts-expect-error
122125
onEnd: (event: PanGestureHandlerEventPayload) => {
123126
if (dismissible) {
124127
const velocity = getDismissVelocity(event, directions, getTranslationOptions(), threshold);

0 commit comments

Comments
 (0)