import { memo } from 'react'; import { RNGestureHandler } from './RNGestureHandler'; import { PanResponderHandler } from './PanResponderHandler'; import type { DispatchEvents, GestureProps } from '../types'; let RNGH: any = null; type GestureHandlerProps = GestureProps & { dispatchEvents: DispatchEvents; }; export const GestureHandler = memo(function GestureHandler({ dispatchEvents, gesture, useRNGH = false, }: GestureHandlerProps) { if (useRNGH && RNGH) { return ( ); } else { return ; } }); try { RNGH = require('react-native-gesture-handler'); } catch { console.warn( 'react-native-gesture-handler is not installed. Falling back to PanResponder.' ); }