Skip to content

Commit f8f47af

Browse files
authored
[General] Restore handlerTag to events (#3881)
## Description Restores `handlerTag` to the update and state change events. This information will be necessary to use the new state manager added in #3880. ## Test plan Verify that `handlerTag` exists on events
1 parent 480a494 commit f8f47af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/react-native-gesture-handler/src/v3/hooks/utils/eventUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function flattenAndFilterEvent<THandlerData>(
4141
): GestureEvent<THandlerData> {
4242
'worklet';
4343

44-
return { ...event.handlerData };
44+
return { handlerTag: event.handlerTag, ...event.handlerData };
4545
}
4646

4747
export function isEventForHandlerWithTag<THandlerData>(

packages/react-native-gesture-handler/src/v3/types/EventTypes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export type TouchEvent =
4949
| GestureTouchEvent
5050
| NativeSyntheticEvent<GestureTouchEvent>;
5151

52-
export type GestureEvent<THandlerData> = HandlerData<THandlerData>;
52+
export type GestureEvent<THandlerData> = {
53+
handlerTag: number;
54+
} & HandlerData<THandlerData>;
5355

5456
export type UnpackedGestureHandlerEvent<THandlerData> =
5557
| GestureEvent<THandlerData>

0 commit comments

Comments
 (0)