-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[General] Hide internal fields from gesture events #3844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
packages/react-native-gesture-handler/src/v3/types/EventTypes.ts
Outdated
Show resolved
Hide resolved
packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFlingGesture.ts
Outdated
Show resolved
Hide resolved
| std::dynamic_pointer_cast<const RNGestureHandlerDetectorEventEmitter>(_eventEmitter) | ||
| ->onGestureHandlerAnimatedEvent({ | ||
| .state = event.state, | ||
| .handlerTag = event.handlerTag, | ||
| .handlerData = event.handlerData, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only formatting, right? Do we want that in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't even notice that. It must have been added by lint-staged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind it, so I'll leave it up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to have it here as it will affect blame. But if you leave it it will also be fine.
Description
Hides internal fields (
state,oldState, andhandlerTag) from the Gesture Handler events exposed externally. Those shouldn't be needed when using the v3 api and clutter the events.This also means that update events don't differ from the update events in shape, so they became redundant.
Test plan
Verify that
state,oldState, andhandlerTagare hidden from events.