From 6fa85d2113c78d72abf870f794ea4720ca340ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Mon, 20 Oct 2025 15:59:12 +0200 Subject: [PATCH] Fix hasWorkletEventHandlers --- .../src/v3/hooks/utils/reanimatedUtils.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 );