UNPKG

737 BTypeScriptView Raw
1import * as React from 'react';
2import {
3 PanGestureHandler as PanGestureHandlerNative,
4 PanGestureHandlerProperties,
5} from 'react-native-gesture-handler';
6
7import GestureHandlerRefContext from '../utils/GestureHandlerRefContext';
8
9export function PanGestureHandler(props: PanGestureHandlerProperties) {
10 const gestureRef = React.useRef<PanGestureHandlerNative>(null);
11
12 return (
13 <GestureHandlerRefContext.Provider value={gestureRef}>
14 <PanGestureHandlerNative {...props} ref={gestureRef} />
15 </GestureHandlerRefContext.Provider>
16 );
17}
18
19export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
20export {
21 GestureHandlerRootView,
22 State as GestureState,
23} from 'react-native-gesture-handler';