diff --git a/packages/react-native-gesture-handler/src/v3/hooks/utils/reanimatedUtils.ts b/packages/react-native-gesture-handler/src/v3/hooks/utils/reanimatedUtils.ts index 300ec5f0ad..87441a1b68 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/utils/reanimatedUtils.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/utils/reanimatedUtils.ts @@ -1,6 +1,11 @@ import RNGestureHandlerModule from '../../../RNGestureHandlerModule'; import { Reanimated } from '../../../handlers/gestures/reanimatedWrapper'; -import { BaseGestureConfig, SharedValue, SharedValueOrT } from '../../types'; +import { + BaseGestureConfig, + GestureCallbacks, + SharedValue, + SharedValueOrT, +} from '../../types'; import { HandlerCallbacks } from './propsWhiteList'; // Variant of djb2 hash function. @@ -88,9 +93,8 @@ export function hasWorkletEventHandlers( config: BaseGestureConfig ) { return Object.entries(config).some( - (key, value) => - (key as keyof BaseGestureConfig) in - HandlerCallbacks && + ([key, value]) => + HandlerCallbacks.has(key as keyof GestureCallbacks) && typeof value === 'function' && '__workletHash' in value );