From 1c67b82b7c4ee7e8c57a6ac297ff37fd65e39935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Fri, 7 Aug 2026 17:13:16 +0200 Subject: [PATCH 1/4] chore: update reanimated api --- .../runOnJSReanimatedHandlers.test.tsx | 8 --- .../src/components/ReanimatedDrawerLayout.tsx | 24 ++++---- .../ReanimatedSwipeable.tsx | 60 +++++++++++-------- .../handlers/gestures/reanimatedWrapper.ts | 37 ++++++------ .../callbacks/useReanimatedEventHandler.ts | 13 ++-- .../src/v3/hooks/useJSResponderHandler.ts | 16 ++--- .../src/v3/hooks/utils/reanimatedUtils.ts | 19 ++++-- 7 files changed, 90 insertions(+), 87 deletions(-) diff --git a/packages/react-native-gesture-handler/src/__tests__/runOnJSReanimatedHandlers.test.tsx b/packages/react-native-gesture-handler/src/__tests__/runOnJSReanimatedHandlers.test.tsx index ff971cc9d6..2067722ae2 100644 --- a/packages/react-native-gesture-handler/src/__tests__/runOnJSReanimatedHandlers.test.tsx +++ b/packages/react-native-gesture-handler/src/__tests__/runOnJSReanimatedHandlers.test.tsx @@ -12,14 +12,6 @@ jest.mock('../handlers/gestures/reanimatedWrapper', () => { useEvent: jest.fn(() => jest.fn()), isSharedValue: (value: unknown): boolean => value !== null && typeof value === 'object' && 'value' in value, - isWorkletFunction: (value: unknown): boolean => - typeof value === 'function' && '__workletHash' in value, - makeMutable: (value: T) => ({ value }), - runOnUI: () => jest.fn(), - runOnJS: - (fn: (...args: unknown[]) => unknown) => - (...args: unknown[]) => - fn(...args), useSharedValue: (value: T) => ({ value }), setGestureState: jest.fn(), }; diff --git a/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx b/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx index b80ecfe50a..d1075b323e 100644 --- a/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx +++ b/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx @@ -27,13 +27,13 @@ import type { SharedValue } from 'react-native-reanimated'; import Animated, { Extrapolation, interpolate, - runOnJS, useAnimatedProps, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, } from 'react-native-reanimated'; +import { scheduleOnRN } from 'react-native-worklets'; import type { ActiveCursor, @@ -339,7 +339,7 @@ const DrawerLayout = function DrawerLayout( const openValue = useSharedValue(0); useDerivedValue(() => { - onDrawerSlide && runOnJS(onDrawerSlide)(openValue.value); + onDrawerSlide && scheduleOnRN(onDrawerSlide, openValue.value); }, []); const isDrawerOpen = useSharedValue(false); @@ -352,7 +352,7 @@ const DrawerLayout = function DrawerLayout( (newState: DrawerState, drawerWillShow: boolean) => { 'worklet'; onDrawerStateChanged && - runOnJS(onDrawerStateChanged)?.(newState, drawerWillShow); + scheduleOnRN(onDrawerStateChanged, newState, drawerWillShow); }, [onDrawerStateChanged] ); @@ -392,10 +392,10 @@ const DrawerLayout = function DrawerLayout( isDrawerOpen.value = willShow; emitStateChanged(DrawerState.SETTLING, willShow); - runOnJS(setDrawerState)(DrawerState.SETTLING); + scheduleOnRN(setDrawerState, DrawerState.SETTLING); if (hideStatusBar) { - runOnJS(setStatusBarHidden)(willShow, statusBarAnimation); + scheduleOnRN(setStatusBarHidden, willShow, statusBarAnimation); } const normalizedToValue = interpolate( @@ -426,12 +426,12 @@ const DrawerLayout = function DrawerLayout( (finished) => { if (finished) { emitStateChanged(DrawerState.IDLE, willShow); - runOnJS(setDrawerOpened)(willShow); - runOnJS(setDrawerState)(DrawerState.IDLE); + scheduleOnRN(setDrawerOpened, willShow); + scheduleOnRN(setDrawerState, DrawerState.IDLE); if (willShow) { - onDrawerOpen && runOnJS(onDrawerOpen)?.(); + onDrawerOpen && scheduleOnRN(onDrawerOpen); } else { - onDrawerClose && runOnJS(onDrawerClose)?.(); + onDrawerClose && scheduleOnRN(onDrawerClose); } } } @@ -550,12 +550,12 @@ const DrawerLayout = function DrawerLayout( onActivate: () => { 'worklet'; emitStateChanged(DrawerState.DRAGGING, false); - runOnJS(setDrawerState)(DrawerState.DRAGGING); + scheduleOnRN(setDrawerState, DrawerState.DRAGGING); if (keyboardDismissMode === DrawerKeyboardDismissMode.ON_DRAG) { - runOnJS(dismissKeyboard)(); + scheduleOnRN(dismissKeyboard); } if (hideStatusBar) { - runOnJS(setStatusBarHidden)(true, statusBarAnimation); + scheduleOnRN(setStatusBarHidden, true, statusBarAnimation); } }, onUpdate: (event) => { diff --git a/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx b/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx index 145f5d94b7..b5c211a06c 100644 --- a/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx +++ b/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx @@ -9,17 +9,20 @@ import type { LayoutChangeEvent } from 'react-native'; import { I18nManager, StyleSheet, View } from 'react-native'; import Animated, { interpolate, + isSharedValue, measure, ReduceMotion, - runOnJS, - runOnUI, useAnimatedRef, useAnimatedStyle, useSharedValue, withSpring, } from 'react-native-reanimated'; +import { + isWorkletRuntime, + scheduleOnRN, + scheduleOnUI, +} from 'react-native-worklets'; -import { Reanimated } from '../../handlers/gestures/reanimatedWrapper'; import { tagMessage } from '../../utils'; import { GestureDetector } from '../../v3/detectors'; import type { PanGestureActiveEvent } from '../../v3/hooks/gestures'; @@ -89,22 +92,22 @@ const Swipeable = (props: SwipeableProps) => { // eslint-disable-next-line react-hooks/rules-of-hooks useEffect(() => { - if (!Reanimated?.isSharedValue(dragOffsetFromRight)) { + if (!isSharedValue(dragOffsetFromRight)) { return; } const listenerId = Math.random() + SHARED_VALUE_OFFSET; - Reanimated?.runOnUI(() => { + scheduleOnUI(() => { 'worklet'; dragOffsetFromRight.addListener(listenerId, checkValue); - })(); + }); return () => { - Reanimated?.runOnUI(() => { + scheduleOnUI(() => { 'worklet'; dragOffsetFromRight.removeListener(listenerId); - })(); + }); }; }, [dragOffsetFromRight, checkValue]); } @@ -190,13 +193,15 @@ const Swipeable = (props: SwipeableProps) => { 'worklet'; if (onSwipeableWillOpen && toValue !== 0) { - runOnJS(onSwipeableWillOpen)( + scheduleOnRN( + onSwipeableWillOpen, toValue > 0 ? SwipeDirection.RIGHT : SwipeDirection.LEFT ); } if (onSwipeableWillClose && toValue === 0) { - runOnJS(onSwipeableWillClose)( + scheduleOnRN( + onSwipeableWillClose, fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT ); } @@ -209,13 +214,15 @@ const Swipeable = (props: SwipeableProps) => { 'worklet'; if (onSwipeableOpen && toValue !== 0) { - runOnJS(onSwipeableOpen)( + scheduleOnRN( + onSwipeableOpen, toValue > 0 ? SwipeDirection.RIGHT : SwipeDirection.LEFT ); } if (onSwipeableClose && toValue === 0) { - runOnJS(onSwipeableClose)( + scheduleOnRN( + onSwipeableClose, fromValue > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT ); } @@ -287,14 +294,15 @@ const Swipeable = (props: SwipeableProps) => { shouldEnableTap.value = rowState.value !== 0; }, [ - rowState, animationOptions, + rowState, + rightWidth.value, + leftWidth.value, appliedTranslation, showLeftProgress, - leftWidth, showRightProgress, - rightWidth, dispatchImmediateEvents, + shouldEnableTap, dispatchEndEvents, ] ); @@ -328,37 +336,37 @@ const Swipeable = (props: SwipeableProps) => { () => ({ close() { 'worklet'; - if (_WORKLET) { + if (isWorkletRuntime()) { animateRow(0); return; } - runOnUI(() => { + scheduleOnUI(() => { animateRow(0); - })(); + }); }, openLeft() { 'worklet'; - if (_WORKLET) { + if (isWorkletRuntime()) { updateElementWidths(); animateRow(leftWidth.value); return; } - runOnUI(() => { + scheduleOnUI(() => { updateElementWidths(); animateRow(leftWidth.value); - })(); + }); }, openRight() { 'worklet'; - if (_WORKLET) { + if (isWorkletRuntime()) { updateElementWidths(); animateRow(-rightWidth.value); return; } - runOnUI(() => { + scheduleOnUI(() => { updateElementWidths(); animateRow(-rightWidth.value); - })(); + }); }, reset() { 'worklet'; @@ -544,9 +552,9 @@ const Swipeable = (props: SwipeableProps) => { if (!dragStarted.value) { dragStarted.value = true; if (rowState.value === 0 && onSwipeableOpenStartDrag) { - runOnJS(onSwipeableOpenStartDrag)(direction); + scheduleOnRN(onSwipeableOpenStartDrag, direction); } else if (onSwipeableCloseStartDrag) { - runOnJS(onSwipeableCloseStartDrag)(direction); + scheduleOnRN(onSwipeableCloseStartDrag, direction); } } diff --git a/packages/react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper.ts b/packages/react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper.ts index fc40770c70..689a8cd1ef 100644 --- a/packages/react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper.ts +++ b/packages/react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper.ts @@ -37,12 +37,26 @@ export type SimplifiedShareableHost = { }; type WorkletsPackage = { - getUIRuntimeHolder?: () => object; - createShareable?: ( + getUIRuntimeHolder: () => object; + createShareable: ( hostRuntimeId: number, initial: TValue ) => SimplifiedShareableHost; - UIRuntimeId?: number; + UIRuntimeId: number; + scheduleOnUI: ( + worklet: (...args: Args) => ReturnValue, + ...args: Args + ) => void; + scheduleOnRN: ( + fun: (...args: Args) => ReturnValue, + ...args: Args + ) => void; + isWorkletFunction: < + Args extends unknown[] = unknown[], + ReturnValue = unknown, + >( + value: unknown + ) => value is WorkletFunction; }; export type NativeEventsManager = new (component: { @@ -78,20 +92,9 @@ type ReanimatedPackage = { useSharedValue: (value: T) => SharedValue; setGestureState: (handlerTag: number, newState: number) => void; isSharedValue: (value: unknown) => value is SharedValue; - isWorkletFunction( - value: unknown - ): value is WorkletFunction; useComposedEventHandler( handlers: (((event: T) => void) | null)[] ): (event: T) => void; - // TODO: runOnJS and runOnUI are deprecated. These should be removed in near future. - runOnJS: ( - fn: (...args: A) => R - ) => (...args: Parameters) => void; - runOnUI( - fn: (...args: A) => R - ): (...args: Parameters) => void; - makeMutable(value: T): { value: T }; }; let Reanimated: ReanimatedPackage | undefined; @@ -114,12 +117,6 @@ try { Reanimated = undefined; } -if (!Reanimated?.useSharedValue) { - // @ts-ignore Make sure the loaded module is actually Reanimated, if it's not - // reset the module to undefined so we can fallback to the default implementation - Reanimated = undefined; -} - if (Worklets !== undefined) { ghQueueMicrotask(() => { globalThis.__RNGH_UI_WORKLET_RUNTIME_HOLDER = diff --git a/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts b/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts index c8168e5796..c7e7f0752d 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts @@ -28,11 +28,7 @@ const workletNOOP = () => { }; function createLastUpdateEventMap() { - if ( - Worklets?.createShareable === undefined || - Worklets.UIRuntimeId === undefined || - Reanimated === undefined - ) { + if (Worklets === undefined || Reanimated === undefined) { return undefined; } @@ -57,7 +53,7 @@ type ShareableLastUpdateEventMap = ReturnType; // Takes the map as an argument on purpose: reading the lazy `let` from this // module-scope worklet would snapshot its value at module evaluation — before // the first `getLastUpdateEventMap()` call — so the UI-runtime copy would stay -// `undefined` forever and the cleanup would silently never run. `runOnUI` +// `undefined` forever and the cleanup would silently never run. `scheduleOnUI` // arguments are serialized fresh on every call, so they always carry the // initialized map. function deleteHandlerEventEntry( @@ -87,7 +83,7 @@ export function useReanimatedEventHandler< // The only difference is whether we will send events to Reanimated or not. // The problem here is that if someone passes `Animated.event` as `onUpdate` prop, // it won't be workletized and therefore `useHandler` will throw. In that case we override it to empty `worklet`. - if (!Reanimated?.isWorkletFunction(handlers.onUpdate)) { + if (!Worklets?.isWorkletFunction(handlers.onUpdate)) { return { ...handlers, onUpdate: workletNOOP, @@ -145,7 +141,8 @@ export function useReanimatedEventHandler< prevHandlerTagRef.current = handlerTag; return () => { - Reanimated?.runOnUI?.(deleteHandlerEventEntry)( + Worklets?.scheduleOnUI( + deleteHandlerEventEntry, updateEventMap, handlerTag ); diff --git a/packages/react-native-gesture-handler/src/v3/hooks/useJSResponderHandler.ts b/packages/react-native-gesture-handler/src/v3/hooks/useJSResponderHandler.ts index 36faedc8f5..204b2d1dc7 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/useJSResponderHandler.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/useJSResponderHandler.ts @@ -1,6 +1,6 @@ import { use, useCallback, useEffect, useRef, useState } from 'react'; -import { Reanimated } from '../../handlers/gestures/reanimatedWrapper'; +import { Worklets } from '../../handlers/gestures/reanimatedWrapper'; import { JSResponderContext, updateResponderEventValue, @@ -51,10 +51,9 @@ export function useJSResponderHandler< } useEffect(() => { - const reanimated = Reanimated; const enabledSharedValues = getEnabledSharedValues(gesture); - if (reanimated === undefined || enabledSharedValues.length === 0) { + if (Worklets === undefined || enabledSharedValues.length === 0) { return; } @@ -63,7 +62,7 @@ export function useJSResponderHandler< return; } - const { runOnJS } = reanimated; + const { scheduleOnUI, scheduleOnRN } = Worklets; const notifyEnabledChanged = () => { setEnabledSharedValueRevision((revision) => revision + 1); @@ -75,7 +74,9 @@ export function useJSResponderHandler< notify: () => void ) => { 'worklet'; - const listener = runOnJS(notify); + const listener = () => { + scheduleOnRN(notify); + }; for (const sharedValue of sharedValues) { sharedValue.addListener(id, listener); @@ -92,14 +93,15 @@ export function useJSResponderHandler< } }; - reanimated.runOnUI(attachListeners)( + scheduleOnUI( + attachListeners, enabledSharedValues, listenerId, notifyEnabledChanged ); return () => { - reanimated.runOnUI(detachListeners)(enabledSharedValues, listenerId); + scheduleOnUI(detachListeners, enabledSharedValues, listenerId); }; }, [gesture]); 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 1d08ee0f1d..c25a0b575b 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,4 +1,7 @@ -import { Reanimated } from '../../../handlers/gestures/reanimatedWrapper'; +import { + Reanimated, + Worklets, +} from '../../../handlers/gestures/reanimatedWrapper'; import { NativeProxy } from '../../NativeProxy'; import type { BaseGestureConfig, @@ -35,7 +38,9 @@ export function bindSharedValues< config: BaseGestureConfig, handlerTag: number ) { - if (Reanimated === undefined) { + const scheduleOnUI = Worklets?.scheduleOnUI; + + if (Reanimated === undefined || scheduleOnUI === undefined) { return; } @@ -64,7 +69,7 @@ export function bindSharedValues< continue; } - Reanimated.runOnUI(attachListener)(maybeSharedValue, key); + scheduleOnUI(attachListener, maybeSharedValue, key); } } @@ -76,7 +81,9 @@ export function unbindSharedValues< config: BaseGestureConfig, handlerTag: number ) { - if (Reanimated === undefined) { + const scheduleOnUI = Worklets?.scheduleOnUI; + + if (Reanimated === undefined || scheduleOnUI === undefined) { return; } @@ -90,9 +97,9 @@ export function unbindSharedValues< const keyHash = hash(key); const listenerId = baseListenerId + keyHash; - Reanimated.runOnUI(() => { + scheduleOnUI(() => { maybeSharedValue.removeListener(listenerId); - })(); + }); } } From 6cc1c89958f65996b12fb86bd886152b7d522f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Fri, 7 Aug 2026 17:16:45 +0200 Subject: [PATCH 2/4] chore: cleanup --- .../components/ReanimatedSwipeable/ReanimatedSwipeable.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx b/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx index b5c211a06c..4881db1dc7 100644 --- a/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx +++ b/packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx @@ -294,15 +294,14 @@ const Swipeable = (props: SwipeableProps) => { shouldEnableTap.value = rowState.value !== 0; }, [ - animationOptions, rowState, - rightWidth.value, - leftWidth.value, + animationOptions, appliedTranslation, showLeftProgress, + leftWidth, showRightProgress, + rightWidth, dispatchImmediateEvents, - shouldEnableTap, dispatchEndEvents, ] ); From f5b45f61d437d9a6e4b181e839ad62569b2c4f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Fri, 7 Aug 2026 17:54:40 +0200 Subject: [PATCH 3/4] fix mock --- ...native-worklets-npm-0.9.1-5bc5b900ed.patch | 14 ++++++ apps/basic-example/package.json | 2 +- apps/common-app/package.json | 2 +- apps/expo-example/package.json | 2 +- apps/macos-example/package.json | 2 +- .../react-native-gesture-handler/package.json | 2 +- yarn.lock | 48 +++++++++---------- 7 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 .yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch diff --git a/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch b/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch new file mode 100644 index 0000000000..e6396c11b4 --- /dev/null +++ b/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch @@ -0,0 +1,14 @@ +diff --git a/src/mock.ts b/src/mock.ts +index b82bb310c288221b392282d8660738e525aac9ab..a1516c5d68d9b9068e7f3178b81fbdc0f0e1d75c 100644 +--- a/src/mock.ts ++++ b/src/mock.ts +@@ -44,6 +44,9 @@ const WorkletAPI = { + }, + scheduleOnRuntime: IMMEDIATE_CALLBACK_INVOCATION, + createSerializable: ID, ++ createShareable: (hostRuntimeId: number, initial: unknown) => ({ ++ value: initial, ++ }), + isSerializableRef: ID, + serializableMappingCache: new Map(), + createSynchronizable: ID, diff --git a/apps/basic-example/package.json b/apps/basic-example/package.json index 2bb4b2db83..2606066116 100644 --- a/apps/basic-example/package.json +++ b/apps/basic-example/package.json @@ -21,7 +21,7 @@ "react-native": "0.86.0", "react-native-gesture-handler": "workspace:*", "react-native-reanimated": "~4.4.1", - "react-native-worklets": "0.9.1" + "react-native-worklets": "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/apps/common-app/package.json b/apps/common-app/package.json index ff51e0fbcc..b0728726c4 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -28,7 +28,7 @@ "react-native-safe-area-context": "~5.7.0", "react-native-screens": "4.25.2", "react-native-svg": "15.15.4", - "react-native-worklets": "0.9.1" + "react-native-worklets": "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/apps/expo-example/package.json b/apps/expo-example/package.json index 38f5752493..0a8f736d6c 100644 --- a/apps/expo-example/package.json +++ b/apps/expo-example/package.json @@ -31,7 +31,7 @@ "react-native-screens": "4.25.2", "react-native-svg": "15.15.4", "react-native-web": "^0.21.0", - "react-native-worklets": "0.9.1" + "react-native-worklets": "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/apps/macos-example/package.json b/apps/macos-example/package.json index a2f8158d1a..8162564e85 100644 --- a/apps/macos-example/package.json +++ b/apps/macos-example/package.json @@ -25,7 +25,7 @@ "react-native-safe-area-context": "~5.7.0", "react-native-screens": "4.25.2", "react-native-svg": "15.15.4", - "react-native-worklets": "0.8.1" + "react-native-worklets": "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/packages/react-native-gesture-handler/package.json b/packages/react-native-gesture-handler/package.json index ad1db4ad73..9ee7ea0a3c 100644 --- a/packages/react-native-gesture-handler/package.json +++ b/packages/react-native-gesture-handler/package.json @@ -98,7 +98,7 @@ "react-native": "0.86.0", "react-native-builder-bob": "^0.40.13", "react-native-reanimated": "~4.4.1", - "react-native-worklets": "0.9.1", + "react-native-worklets": "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch", "react-test-renderer": "19.2.3", "typescript": "~6.0.3" }, diff --git a/yarn.lock b/yarn.lock index d5ad4709c2..958a25239b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -718,7 +718,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.25.4, @babel/plugin-transform-class-properties@npm:^7.27.1, @babel/plugin-transform-class-properties@npm:^7.28.6, @babel/plugin-transform-class-properties@npm:^7.29.7": +"@babel/plugin-transform-class-properties@npm:^7.25.4, @babel/plugin-transform-class-properties@npm:^7.28.6, @babel/plugin-transform-class-properties@npm:^7.29.7": version: 7.29.7 resolution: "@babel/plugin-transform-class-properties@npm:7.29.7" dependencies: @@ -742,7 +742,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.25.4, @babel/plugin-transform-classes@npm:^7.28.4, @babel/plugin-transform-classes@npm:^7.28.6, @babel/plugin-transform-classes@npm:^7.29.7": +"@babel/plugin-transform-classes@npm:^7.25.4, @babel/plugin-transform-classes@npm:^7.28.6, @babel/plugin-transform-classes@npm:^7.29.7": version: 7.29.7 resolution: "@babel/plugin-transform-classes@npm:7.29.7" dependencies: @@ -1016,7 +1016,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.7, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.27.1, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.28.6, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.29.7": +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.7, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.28.6, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.29.7": version: 7.29.7 resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.29.7" dependencies: @@ -1076,7 +1076,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.24.8, @babel/plugin-transform-optional-chaining@npm:^7.27.1, @babel/plugin-transform-optional-chaining@npm:^7.28.6, @babel/plugin-transform-optional-chaining@npm:^7.29.7": +"@babel/plugin-transform-optional-chaining@npm:^7.24.8, @babel/plugin-transform-optional-chaining@npm:^7.28.6, @babel/plugin-transform-optional-chaining@npm:^7.29.7": version: 7.29.7 resolution: "@babel/plugin-transform-optional-chaining@npm:7.29.7" dependencies: @@ -1495,7 +1495,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.12.7, @babel/preset-typescript@npm:^7.23.0, @babel/preset-typescript@npm:^7.24.7, @babel/preset-typescript@npm:^7.27.1, @babel/preset-typescript@npm:^7.28.5": +"@babel/preset-typescript@npm:^7.12.7, @babel/preset-typescript@npm:^7.23.0, @babel/preset-typescript@npm:^7.24.7, @babel/preset-typescript@npm:^7.28.5": version: 7.29.7 resolution: "@babel/preset-typescript@npm:7.29.7" dependencies: @@ -5965,7 +5965,7 @@ __metadata: react-native: "npm:0.86.0" react-native-gesture-handler: "workspace:*" react-native-reanimated: "npm:~4.4.1" - react-native-worklets: "npm:0.9.1" + react-native-worklets: "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" react-test-renderer: "npm:19.2.3" typescript: "npm:~6.0.3" languageName: unknown @@ -6567,7 +6567,7 @@ __metadata: react-native-safe-area-context: "npm:~5.7.0" react-native-screens: "npm:4.25.2" react-native-svg: "npm:15.15.4" - react-native-worklets: "npm:0.9.1" + react-native-worklets: "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" react-test-renderer: "npm:19.0.0" typescript: "npm:~6.0.3" peerDependencies: @@ -8394,7 +8394,7 @@ __metadata: react-native-screens: "npm:4.25.2" react-native-svg: "npm:15.15.4" react-native-web: "npm:^0.21.0" - react-native-worklets: "npm:0.9.1" + react-native-worklets: "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" typescript: "npm:~6.0.3" languageName: unknown linkType: soft @@ -11158,7 +11158,7 @@ __metadata: react-native-safe-area-context: "npm:~5.7.0" react-native-screens: "npm:4.25.2" react-native-svg: "npm:15.15.4" - react-native-worklets: "npm:0.8.1" + react-native-worklets: "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" react-test-renderer: "npm:19.1.4" typescript: "npm:~6.0.3" languageName: unknown @@ -13331,7 +13331,7 @@ __metadata: react-native: "npm:0.86.0" react-native-builder-bob: "npm:^0.40.13" react-native-reanimated: "npm:~4.4.1" - react-native-worklets: "npm:0.9.1" + react-native-worklets: "patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch" react-test-renderer: "npm:19.2.3" typescript: "npm:~6.0.3" peerDependencies: @@ -13506,33 +13506,33 @@ __metadata: languageName: node linkType: hard -"react-native-worklets@npm:0.8.1": - version: 0.8.1 - resolution: "react-native-worklets@npm:0.8.1" +"react-native-worklets@npm:0.9.1": + version: 0.9.1 + resolution: "react-native-worklets@npm:0.9.1" dependencies: "@babel/plugin-transform-arrow-functions": "npm:^7.27.1" - "@babel/plugin-transform-class-properties": "npm:^7.27.1" - "@babel/plugin-transform-classes": "npm:^7.28.4" - "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.27.1" - "@babel/plugin-transform-optional-chaining": "npm:^7.27.1" + "@babel/plugin-transform-class-properties": "npm:^7.28.6" + "@babel/plugin-transform-classes": "npm:^7.28.6" + "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.28.6" + "@babel/plugin-transform-optional-chaining": "npm:^7.28.6" "@babel/plugin-transform-shorthand-properties": "npm:^7.27.1" "@babel/plugin-transform-template-literals": "npm:^7.27.1" "@babel/plugin-transform-unicode-regex": "npm:^7.27.1" - "@babel/preset-typescript": "npm:^7.27.1" + "@babel/preset-typescript": "npm:^7.28.5" convert-source-map: "npm:^2.0.0" - semver: "npm:^7.7.3" + semver: "npm:^7.7.4" peerDependencies: "@babel/core": "*" "@react-native/metro-config": "*" react: "*" - react-native: 0.81 - 0.85 - checksum: 10c0/a82edbd65b09a31d973497dac899adcd618677b56f7e5c460fd9f3b1b4ef1547b7bfd2edaa644d1ebf866bf70658bdbd1314c9d0ab2856e98c6975d0e97fd449 + react-native: 0.83 - 0.86 + checksum: 10c0/a3612d9c2b3613c789dc0b15ffe4e200681b8e64a715029748d29fb4176930765f1afb9fa4d625c02a2c136f3c331ab488e28fbb75e28295fa15edd4000195f3 languageName: node linkType: hard -"react-native-worklets@npm:0.9.1": +"react-native-worklets@patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch": version: 0.9.1 - resolution: "react-native-worklets@npm:0.9.1" + resolution: "react-native-worklets@patch:react-native-worklets@npm%3A0.9.1#~/.yarn/patches/react-native-worklets-npm-0.9.1-5bc5b900ed.patch::version=0.9.1&hash=fc6084" dependencies: "@babel/plugin-transform-arrow-functions": "npm:^7.27.1" "@babel/plugin-transform-class-properties": "npm:^7.28.6" @@ -13550,7 +13550,7 @@ __metadata: "@react-native/metro-config": "*" react: "*" react-native: 0.83 - 0.86 - checksum: 10c0/a3612d9c2b3613c789dc0b15ffe4e200681b8e64a715029748d29fb4176930765f1afb9fa4d625c02a2c136f3c331ab488e28fbb75e28295fa15edd4000195f3 + checksum: 10c0/1ae3459931a30405c8dbf96e650b9777409fc472847d041cfb70f8f5828643fa0968063edce089eb8aa140c719a2040f9ef2efa60e30b6df09292d199692717b languageName: node linkType: hard From e4ec9d228ec178275bdc70336584e1bd349ee0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 10 Aug 2026 09:52:30 +0200 Subject: [PATCH 4/4] fix: imports --- .../src/v3/hooks/callbacks/useReanimatedEventHandler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts b/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts index 60a17115d6..e51e10d601 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts @@ -4,7 +4,10 @@ import type { ReanimatedContext, ReanimatedHandler, } from '../../../handlers/gestures/reanimatedWrapper'; -import { Reanimated } from '../../../handlers/gestures/reanimatedWrapper'; +import { + Reanimated, + Worklets, +} from '../../../handlers/gestures/reanimatedWrapper'; import type { ChangeCalculatorType, GestureCallbacks,