Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to use pinch gesture handle event type (#1194)
## Description <!-- Description and motivation for this PR. Inlude Fixes #<number> if this is fixing some issue. Fixes # . --> Right now there is no way to use pinch gesture handler with `useAnimatedGestureHandler` in typescript because of wrong typing. This PR fixes it. Fixes #1164 Now when we want to use PanGestureHandler, we can just use `useAnimatedGestureHandler`, but if you want to use typed context, you need to pass both context type and gesture handler type: ```ts const handler = useAnimatedGestureHandler< PanGestureHandlerGestureEvent, { someContextProp: number; }, >(handlers); ``` For all the other handlers, you need to pass them: ```ts const tapHandler = useAnimatedGestureHandler< TapGestureHandlerGestureEvent, >(handlers); ``` By default, the context has a type of an empty object. ## Changes <!-- Please describe things you've changed here, make a **high level** overview, if change is simple you can omit this section. For example: - Added `foo` method which add bouncing animation - Updated `about.md` docs - Added caching in CI builds --> - Typings: Add ability to pass event type to useAnimatedGestureHandler <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After -->
- Loading branch information