File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -341,18 +341,22 @@ export default function createHandler<
341
341
} ) ;
342
342
343
343
const actionType = ( ( ) => {
344
- if (
345
- ( this . props ?. onGestureEvent &&
346
- 'current' in this . props . onGestureEvent ) ||
347
- ( this . props ?. onHandlerStateChange &&
348
- 'current' in this . props . onHandlerStateChange )
349
- ) {
344
+ const onGestureEvent = this . props ?. onGestureEvent ;
345
+ const isGestureHandlerWorklet =
346
+ onGestureEvent &&
347
+ ( 'current' in onGestureEvent ||
348
+ 'workletEventHandler' in onGestureEvent ) ;
349
+ const onHandlerStateChange = this . props ?. onHandlerStateChange ;
350
+ const isStateChangeHandlerWorklet =
351
+ onHandlerStateChange &&
352
+ ( 'current' in onHandlerStateChange ||
353
+ 'workletEventHandler' in onHandlerStateChange ) ;
354
+ const isReanimatedHandler =
355
+ isGestureHandlerWorklet || isStateChangeHandlerWorklet ;
356
+ if ( isReanimatedHandler ) {
350
357
// Reanimated worklet
351
358
return ActionType . REANIMATED_WORKLET ;
352
- } else if (
353
- this . props ?. onGestureEvent &&
354
- '__isNative' in this . props . onGestureEvent
355
- ) {
359
+ } else if ( onGestureEvent && '__isNative' in onGestureEvent ) {
356
360
// Animated.event with useNativeDriver: true
357
361
return ActionType . NATIVE_ANIMATED_EVENT ;
358
362
} else {
You can’t perform that action at this time.
0 commit comments