Gesture Handler 3
This is the first beta release for Gesture Handler 3, with significant internal changes tailored towards the new Architecture and a new hook-based API. To get a high-level overview of the changes, you can check out our release blog post, or see the detailed changelog below.
Detailed changelog
- Update how Gesture Handler exposes
setGestureStateto the Reanimated UI runtime by @j-piasecki in #3207 - Simplify Android event builders by @j-piasecki in #3603
- Remove actions testing build for the old architecture by @j-piasecki in #3604
- Implement base for a native detector component by @j-piasecki in #3599
NativeDetector<->Reanimatedintegration by @m-bert in #3617- Remove
onChangecallback references by @m-bert in #3631 - Handle
Animated.EventinonUpdatecallback by @m-bert in #3630 - Fix
onUpdatecrash by @m-bert in #3636 - Remove
AnimatedEventaction type fromNativeDetectorby @m-bert in #3646 - Automatically assign
dispatchesAnimatedEventsby @m-bert in #3650 - Remove
dispatchesAnimatedEventsfrom the native detector by @j-piasecki in #3652 - Adapt
NativeViewGestureHandlertoNativeDetectorby @m-bert in #3638 - [Web] Native detector component by @akwasniewski in #3637
- [Web] Adapt
NativeViewGestureHandlertoNativeDetectorby @akwasniewski in #3653 - Add
overridekeyword toTypeScriptpart of codebase by @m-bert in #3667 - Lazy addition of callbacks to
useHandlerby @m-bert in #3674 - Remove paper support by @latekvo in #3639
- Fix native gesture reattach by @akwasniewski in #3672
- [Web] v3 typing and using handler data by @akwasniewski in #3651
- Fix gesture detach on component drop by @akwasniewski in #3669
- Remove
sync-architecturesscript from commit hook by @m-bert in #3681 - Bind
SharedValuesin handler config by @m-bert in #3658 - [Web] many children check by @akwasniewski in #3684
- [cherry-pick] Support react-native 0.81 (#3607) by @m-bert in #3688
- Fix
ConcurrentModificationExceptionby @m-bert in #3691 - Fix macos newarch flag by @akwasniewski in #3692
- [Web] Config refactor - update logic and drop class field by @akwasniewski in #3673
- Bump Reanimated in
expo-exampleby @m-bert in #3690 - Separate
ReanimatedfromJSby @m-bert in #3682 - Gesture relations by @m-bert in #3693
- [Tests] Tests for relations traversal algorithm by @m-bert in #3701
- Bump libraries versions by @m-bert in #3702
- Properly type gesture config by @m-bert in #3700
- Align web events with native by @akwasniewski in #3707
- Remove remaining
anyin gesture config type by @m-bert in #3709 - [Web] Separate Reanimated from JS by @akwasniewski in #3683
- Typed gesture hooks by @m-bert in #3706
- Fix relations old api by @akwasniewski in #3715
- [Web] Gesture relations by @akwasniewski in #3713
- Update hook usage in the NativeDetector by @j-piasecki in #3714
- fix relations by @akwasniewski in #3722
- [Web] Remove mouse buttons map by @m-bert in #3728
- [Web] Add
nameproperty to handlers by @m-bert in #3729 - Add
changeEventCalculatorto handlers by @m-bert in #3708 - Add
SharedValuetype to config. by @m-bert in #3717 - Logic Detector by @akwasniewski in #3689
- Fix composed types by @m-bert in #3744
- Filter config by @m-bert in #3710
- Remove deprecated components by @m-bert in #3734
- Do not use
handleGestureEventforAnimated.Eventby @m-bert in #3748 - Change logic of
workletdetection in config by @m-bert in #3745 - [Web] Disable
onPointerMoveon hover on gestures other thanHoverby @m-bert in #3727 - Split
utilsinto multiple files by @m-bert in #3746 - Add
runOnJSto config by @m-bert in #3743 - Add missing types by @akwasniewski in #3731
- Split types by @m-bert in #3750
- Fix
hasWorkletEventHandlersby @m-bert in #3758 - [Web] Fix handling of
enabledprop by @m-bert in #3726 - Bump
nodein DFS CI by @m-bert in #3774 - Reattach gestures when the Detector moves back to the window on iOS by @j-piasecki in #3771
- Update props whitelists by @m-bert in #3773
- Clean callbacks when unregistering gesture by @j-piasecki in #3775
- Remove
RNGestureHandlerEnabledRootViewandgestureHandlerRootHOCby @m-bert in #3780 - Add support for nested Text to LogicDetector by @j-piasecki in #3778
- Remove remaining paper references by @m-bert in #3783
- Remove checks for React 19 by @m-bert in #3785
- One detector to rule them all by @akwasniewski in #3732
- [Android] Remove workaround for touch events allowing to change state too soon by @j-piasecki in #3793
- [General] Fix
DiagonalDirectionstype by @j-piasecki in #3795 - Remove incorrectly passed
gestureEventsby @m-bert in #3799 - Rename logic detector to virtual detector by @akwasniewski in #3796
- Virtual detector native gestures by @akwasniewski in #3765
- Throw error when detectors are not placed inside
GestureHandlerRootViewby @m-bert in #3798 - [Web] Remove workaround for touch events allowing to change state too soon by @j-piasecki in #3794
- [Types] Remove
onUpdatefrom discrete gestures by @j-piasecki in #3811 - [Web] Don't try to remove context menu listeners when not initialized by @j-piasecki in #3814
- [iOS] Correctly attach
Nativegesture by @m-bert in #3802 - Memoize internal event handlers by @j-piasecki in #3812
- Rename
onTouchesCancelledtoonTouchesCancelby @j-piasecki in #3818 - Rename relation props in config by @j-piasecki in #3817
- Memoize cloned configs in gesture hooks by @j-piasecki in #3816
- Apply more granular memoization by @j-piasecki in #3815
- [iOS] Remove dropped native handlers by @m-bert in #3819
- Swipeable and drawer, new api by @akwasniewski in #3803
- Simplify
VirtualDetector/InterceptingGestureDetectorand reduce the number of renders by @j-piasecki in #3813 - [General] Make
VirtualDetectorpart of the public API by @j-piasecki in #3825 - [Android][iOS] Don't handle events on the detector surface by @j-piasecki in #3823
- [General] Allow explicit opt-in for the Animated codepaths when not using native driver by @j-piasecki in #3824
- [General] Make
InterceptingGestureDetectorthrow when not rendered under GHRootView by @j-piasecki in #3829 - [Web] Fix context menu by @m-bert in #3826
- [General] Rename gesture hooks to include
Gesturesuffix by @j-piasecki in #3828 - [General] Schedule flushes instead of flushing immediately by @j-piasecki in #3830
- [Web] Use correct config field for Reanimated flag by @j-piasecki in #3835
- Rename gesture composition hooks by @j-piasecki in #3834
- [General] Batch native operations by @j-piasecki in #3831
- [General] Reduce the number of calls to
useEventby @j-piasecki in #3836 - [General] Unwrap
handlerDatawhen passing event to user-defined callbacks by @j-piasecki in #3840 - [iOS] Fix Animated events with no native driver by @j-piasecki in #3841
- [General] Rename
useMultipleGesturestouseCompetingGesturesby @j-piasecki in #3848 - [General] Rename
onStart/onEndtoonActivate/onDeactivateby @j-piasecki in #3847 - Fix imports by @m-bert in #3845
- Update
InterceptingGestureDetectorwith Text example by @j-piasecki in #3851 - [General] Listen for Reanimated events directly, without
createAnimatedComponentwhen possible by @j-piasecki in #3837 - [General] Hide internal fields from gesture events by @j-piasecki in #3844
- [General] Reduce number of created closures by @j-piasecki in #3853
- Change components implementation by @m-bert in #3800
- Change exports by @m-bert in #3858
- Handle
testIDprop by @m-bert in #3838 - [Android] Fix
ScrollViewby @m-bert in #3867 - Correctly expose
avgTouchesby @m-bert in #3869 - Bring back missing fields from events by @m-bert in #3871
- Add missing
cancelsTouchesInViewby @m-bert in #3870 - Change
directiontype inFlingby @m-bert in #3872 - Revert "Change direction type" by @m-bert in #3876
- Change
runCallbacktypes by @m-bert in #3860 - Change
hoverEffecttoeffectby @m-bert in #3878 - [General] Restore
handlerTagto events by @j-piasecki in #3881 - [Web] Detector DOM props by @m-bert in #3877
- [docs] Gesture hooks by @m-bert in #3868
- [docs] Update team by @m-bert in #3892
- [Docs] Add compatibility table by @m-bert in #3882
- [docs] Add sorn25 banner to readme by @p-malecki in #3893
- State Manager by @akwasniewski in #3880
- State manager deactivate by @akwasniewski in #3910
- [web] Fix handlers not sending events by @m-bert in #3911
- [iOS] Fix
ScrollViewdetection when used with NativeDetector by @j-piasecki in #3888 - [General] Pass
testIDto native side in dev by @j-piasecki in #3883 - Increase maximum number of tracked pointers by @m-bert in #3915
- Rename
tagtohandlerTagby @m-bert in #3916 - Add CMakeLists.txt to package by @m-bert in #3917
- [docs] Remove sorn25 banner from readme by @p-malecki in #3922
- add manualActivation prop by @akwasniewski in #3923
- fix(iOS): handles
pointerEventsforPressablecomponent by @huextrat in #3925 - fix(android): handles
pointerEventsforPressablecomponent by @huextrat in #3927 - [General] Cleanup duplicated callbacks by @j-piasecki in #3885
- V3 pressable by @akwasniewski in #3907
- [General] Fix layout jumps with native detector by @j-piasecki in #3930
- [docs] Gesture detectors by @m-bert in #3894
display: contentsbased button styling by @j-piasecki in #3634- [iOS] Restore scroll view behavior on gesture unbind by @j-piasecki in #3931
- [General] Fix
onBeginnot being called when the native recognizer skips theBEGANstate by @j-piasecki in #3932 - [docs] Update quick start by @m-bert in #3895
- Update the script responsible for updating the package version by @j-piasecki in #3934
- Move
Reanimatedavailability check toJSside by @m-bert in #3935 - [web] fix context menu by @akwasniewski in #3939
- Fix state manager on unregistered gestures by @akwasniewski in #3913
- [iOS] Prevent gesture recognizers from beginning, when they should not by @j-piasecki in #3936
- Update mocks by @akwasniewski in #3854
- Cleaning manually activated handlers by @akwasniewski in #3943
- [Native] Fix
shouldCancelWhenOutsidenot tracking the view by @j-piasecki in #3942 - [General] Update existing events tests by @j-piasecki in #3944
- [docs] State management by @m-bert in #3905
- [docs] Migration guide by @m-bert in #3896
- Fix
HitSloptype in config. by @m-bert in #3946 - Update release flow to be more robust by @j-piasecki in #3938
- Bump github pages workflow by @akwasniewski in #3949
- V3 examples by @akwasniewski in #3857
- [docs] Rename callback and update migration guide by @m-bert in #3951
- Fix intercepting detector props by @akwasniewski in #3952
- Temporarily disable commitly releases by @j-piasecki in #3953
- Merge Gesture Handler 3 working branch to main by @j-piasecki in #3954
New Contributors
- @p-malecki made their first contribution in #3893
- @huextrat made their first contribution in #3925
Full Changelog: v2.30.0...v3.0.0-beta.1