Skip to content

Commit 2c0277a

Browse files
authored
Revert "Change direction type" (#3876)
This reverts commit 3d5e298. ## Description I have overlooked that result of using bitwise `OR` operator on `Directions` is of type `number`. This caused CI to [fail](https://github.com/software-mansion/react-native-gesture-handler/actions/runs/20177351781/job/57928739635#step:5:1). Also, now I see that it didn't cover all cases, so reverting it makes sense. ## Test plan ```tsx const fling = useFlingGesture({ direction: Directions.RIGHT | Directions.LEFT, }); ```
1 parent bfa97c8 commit 2c0277a

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/FlingProperties.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { Directions } from '../../../../Directions';
2-
31
export type FlingGestureNativeProperties = {
42
/**
53
* Expressed allowed direction of movement. It's possible to pass one or many
@@ -15,7 +13,7 @@ export type FlingGestureNativeProperties = {
1513
* direction={Directions.DOWN}
1614
* ```
1715
*/
18-
direction?: Directions;
16+
direction?: number;
1917

2018
/**
2119
* Determine exact number of points required to handle the fling gesture.

packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFlingGesture.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Directions } from '../../../../Directions';
21
import {
32
BaseDiscreteGestureConfig,
43
ExcludeInternalConfigProps,
@@ -18,10 +17,7 @@ type FlingHandlerData = {
1817
absoluteY: number;
1918
};
2019

21-
type FlingGestureProperties = WithSharedValue<
22-
FlingGestureNativeProperties,
23-
Directions
24-
>;
20+
type FlingGestureProperties = WithSharedValue<FlingGestureNativeProperties>;
2521

2622
type FlingGestureInternalConfig = BaseDiscreteGestureConfig<
2723
FlingHandlerData,

0 commit comments

Comments
 (0)