react-native-gesture-handler
- Version 3.0.0
- Published
- 2.85 MB
- 2 dependencies
- MIT license
Install
npm i react-native-gesture-handleryarn add react-native-gesture-handlerpnpm add react-native-gesture-handlerOverview
Declarative API exposing native platform touch and gesture system to React Native
Index
Variables
- Directions
- FlingGestureHandler
- ForceTouchGestureHandler
- Gesture
- GestureStateManager
- LegacyDrawerLayoutAndroid
- LegacyRefreshControl
- LegacySwitch
- LegacyTextInput
- LongPressGestureHandler
- NativeViewGestureHandler
- PanGestureHandler
- PinchGestureHandler
- RefreshControl
- RotationGestureHandler
- State
- Switch
- TapGestureHandler
- TextInput
- TouchableNativeFeedback
Functions
- BaseButton()
- BorderlessButton()
- FlatList()
- GestureDetector()
- GestureHandlerRootView()
- InterceptingGestureDetector()
- legacy_createNativeWrapper()
- LegacyBaseButton()
- LegacyBorderlessButton()
- LegacyFlatList()
- LegacyPressable()
- LegacyRawButton()
- LegacyRectButton()
- LegacyScrollView()
- LegacyText()
- Pressable()
- RawButton()
- RectButton()
- ScrollView()
- Touchable()
- TouchableWithoutFeedback()
- useCompetingGestures()
- useExclusiveGestures()
- useFlingGesture()
- useHoverGesture()
- useLongPressGesture()
- useManualGesture()
- useNativeGesture()
- usePanGesture()
- usePinchGesture()
- useRotationGesture()
- useSimultaneousGestures()
- useTapGesture()
- VirtualGestureDetector()
Classes
Interfaces
Enums
Type Aliases
- ActiveCursor
- ComposedGesture
- Directions
- FlatList
- FlingGesture
- FlingGestureActiveEvent
- FlingGestureConfig
- FlingGestureEvent
- FlingGestureHandler
- FlingGestureHandlerEventPayload
- FlingGestureHandlerGestureEvent
- FlingGestureHandlerProperties
- FlingGestureHandlerStateChangeEvent
- ForceTouchGestureChangeEventPayload
- ForceTouchGestureHandler
- ForceTouchGestureHandlerEventPayload
- ForceTouchGestureHandlerGestureEvent
- ForceTouchGestureHandlerProperties
- ForceTouchGestureHandlerStateChangeEvent
- GestureDetectorProps
- GestureHandlerGestureEvent
- GestureHandlerGestureEventNativeEvent
- GestureHandlerStateChangeEvent
- GestureHandlerStateChangeNativeEvent
- GestureStateChangeEvent
- GestureTouchEvent
- GestureType
- GestureUpdateEvent
- HoverGesture
- HoverGestureActiveEvent
- HoverGestureConfig
- HoverGestureEvent
- LegacyBaseButtonProperties
- LegacyBorderlessButtonProperties
- LegacyComposedGesture
- LegacyDrawerLayoutAndroid
- LegacyExclusiveGesture
- LegacyFlatList
- LegacyFlingGesture
- LegacyForceTouchGesture
- LegacyHoverGesture
- LegacyLongPressGesture
- LegacyManualGesture
- LegacyPanGesture
- LegacyPinchGesture
- LegacyRaceGesture
- LegacyRawButtonProperties
- LegacyRectButtonProperties
- LegacyRefreshControl
- LegacyRotationGesture
- LegacyScrollView
- LegacySimultaneousGesture
- LegacySwitch
- LegacyTapGesture
- LegacyText
- LegacyTextInput
- LongPressGesture
- LongPressGestureActiveEvent
- LongPressGestureConfig
- LongPressGestureEvent
- LongPressGestureHandler
- LongPressGestureHandlerEventPayload
- LongPressGestureHandlerGestureEvent
- LongPressGestureHandlerProperties
- LongPressGestureHandlerStateChangeEvent
- ManualGesture
- ManualGestureActiveEvent
- ManualGestureConfig
- ManualGestureEvent
- NativeGesture
- NativeGestureActiveEvent
- NativeGestureConfig
- NativeGestureEvent
- NativeViewGestureHandler
- NativeViewGestureHandlerGestureEvent
- NativeViewGestureHandlerPayload
- NativeViewGestureHandlerProperties
- NativeViewGestureHandlerStateChangeEvent
- PanGesture
- PanGestureActiveEvent
- PanGestureChangeEventPayload
- PanGestureConfig
- PanGestureEvent
- PanGestureHandler
- PanGestureHandlerEventPayload
- PanGestureHandlerGestureEvent
- PanGestureHandlerProperties
- PanGestureHandlerStateChangeEvent
- PinchGesture
- PinchGestureActiveEvent
- PinchGestureChangeEventPayload
- PinchGestureConfig
- PinchGestureEvent
- PinchGestureHandler
- PinchGestureHandlerEventPayload
- PinchGestureHandlerGestureEvent
- PinchGestureHandlerProperties
- PinchGestureHandlerStateChangeEvent
- PressableStateCallbackType
- RefreshControl
- RotationGesture
- RotationGestureActiveEvent
- RotationGestureConfig
- RotationGestureEvent
- RotationGestureHandler
- RotationGestureHandlerEventPayload
- RotationGestureHandlerGestureEvent
- RotationGestureHandlerProperties
- RotationGestureHandlerStateChangeEvent
- ScrollView
- SingleGesture
- SingleGestureEvent
- SingleGestureTouchEvent
- State
- Switch
- TapGesture
- TapGestureActiveEvent
- TapGestureConfig
- TapGestureEvent
- TapGestureHandler
- TapGestureHandlerEventPayload
- TapGestureHandlerGestureEvent
- TapGestureHandlerProperties
- TapGestureHandlerStateChangeEvent
- TextInput
- TouchableHighlightProps
- TouchableOpacityProps
- TouchableProps
- TouchableWithoutFeedbackProps
- TouchData
Variables
variable Directions
const Directions: { readonly RIGHT: 1; readonly LEFT: 2; readonly UP: 4; readonly DOWN: 8;};variable FlingGestureHandler
const FlingGestureHandler: any;Deprecated
FlingGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Fling()instead.
variable ForceTouchGestureHandler
const ForceTouchGestureHandler: any;Deprecated
ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.ForceTouch()instead.
variable Gesture
const Gesture: { Tap: () => TapGesture; Pan: () => PanGesture; Pinch: () => PinchGesture; Rotation: () => RotationGesture; Fling: () => FlingGesture; LongPress: () => LongPressGesture; ForceTouch: () => ForceTouchGesture; Native: () => NativeGesture; Manual: () => ManualGesture; Hover: () => HoverGesture; Race: (...gestures: Gesture[]) => ComposedGesture; Simultaneous(...gestures: Gesture[]): SimultaneousGesture; Exclusive(...gestures: Gesture[]): ExclusiveGesture;};See Also
https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture
Deprecated
Gesturebuilder API is deprecated and will be removed in a future version of Gesture Handler. Please migrate to the new, hook-based API.Gestureis the object that allows you to create and compose gestures.### Remarks - Consider wrapping your gesture configurations with
useMemo, as it will reduce the amount of work Gesture Handler has to do under the hood when updating gestures.
variable GestureStateManager
const GestureStateManager: GestureStateManagerType;variable LegacyDrawerLayoutAndroid
const LegacyDrawerLayoutAndroid: { ( props: RNDrawerLayoutAndroidProps & { children?: React.ReactNode | undefined; } & NativeViewGestureHandlerProps & { ref?: React.Ref<React.ComponentType<any> | null> | undefined; } ): React.JSX.Element; displayName: any;};Deprecated
use
DrawerLayoutAndroidinstead
variable LegacyRefreshControl
const LegacyRefreshControl: { ( props: import('react-native').RefreshControlProps & NativeViewGestureHandlerProps & { ref?: React.Ref<React.ComponentType<any> | null> | undefined; } ): React.JSX.Element; displayName: any;};Deprecated
use
RefreshControlinstead
variable LegacySwitch
const LegacySwitch: { ( props: RNSwitchProps & NativeViewGestureHandlerProps & { ref?: React.Ref<React.ComponentType<any> | null> | undefined; } ): React.JSX.Element; displayName: any;};Deprecated
use
Switchinstead
variable LegacyTextInput
const LegacyTextInput: { ( props: RNTextInputProps & NativeViewGestureHandlerProps & { ref?: React.Ref<React.ComponentType<any> | null> | undefined; } ): React.JSX.Element; displayName: any;};Deprecated
use
RefreshControlinstead
variable LongPressGestureHandler
const LongPressGestureHandler: any;Deprecated
LongPressGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.LongPress()instead.
variable NativeViewGestureHandler
const NativeViewGestureHandler: any;Deprecated
NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Native()instead.
variable PanGestureHandler
const PanGestureHandler: any;Deprecated
PanGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pan()instead.
variable PinchGestureHandler
const PinchGestureHandler: any;Deprecated
PinchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pinch()instead.
variable RefreshControl
const RefreshControl: { ( props: RNRefreshControlProps & { disableReanimated?: boolean | undefined; useAnimated?: boolean | undefined; testID?: string | undefined; } & { runOnJS?: boolean | import('../types').SharedValue<boolean> | undefined; enabled?: boolean | import('../types').SharedValue<boolean> | undefined; shouldCancelWhenOutside?: | boolean | import('../types').SharedValue<boolean> | undefined; hitSlop?: | number | import('../types').SharedValue<number> | import('../types').SharedValue<null> | { left?: | number | import('../types').SharedValue<number> | undefined; right?: | number | import('../types').SharedValue<number> | undefined; top?: | number | import('../types').SharedValue<number> | undefined; bottom?: | number | import('../types').SharedValue<number> | undefined; vertical?: | number | import('../types').SharedValue<number> | undefined; horizontal?: | number | import('../types').SharedValue<number> | undefined; } | { left: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { right: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { top: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | { bottom: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | null | undefined; activeCursor?: | import('../..').ActiveCursor | import('../types').SharedValue<import('../..').ActiveCursor> | undefined; mouseButton?: | import('../..').MouseButton | import('../types').SharedValue<import('../..').MouseButton> | undefined; cancelsTouchesInView?: | boolean | import('../types').SharedValue<boolean> | undefined; cancelsJSResponder?: | boolean | import('../types').SharedValue<boolean> | undefined; manualActivation?: | boolean | import('../types').SharedValue<boolean> | undefined; } & import('../types').GestureCallbacks< import('../hooks/gestures/native/NativeTypes').NativeHandlerData > & import('../hooks/gestures/native/NativeTypes').NativeGestureNativeProperties & import('../types').ExternalRelations & import('../types/NativeWrapperType').WrapperSpecificProperties<RNRefreshControl | null> ): React.JSX.Element; displayName: any;};variable RotationGestureHandler
const RotationGestureHandler: any;Deprecated
RotationGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Rotation()instead.
variable State
const State: { readonly UNDETERMINED: 0; readonly FAILED: 1; readonly BEGAN: 2; readonly CANCELLED: 3; readonly ACTIVE: 4; readonly END: 5;};variable Switch
const Switch: { ( props: RNSwitchProps & { disableReanimated?: boolean | undefined; useAnimated?: boolean | undefined; testID?: string | undefined; } & { runOnJS?: boolean | import('../types').SharedValue<boolean> | undefined; enabled?: boolean | import('../types').SharedValue<boolean> | undefined; shouldCancelWhenOutside?: | boolean | import('../types').SharedValue<boolean> | undefined; hitSlop?: | number | import('../types').SharedValue<number> | import('../types').SharedValue<null> | { left?: | number | import('../types').SharedValue<number> | undefined; right?: | number | import('../types').SharedValue<number> | undefined; top?: | number | import('../types').SharedValue<number> | undefined; bottom?: | number | import('../types').SharedValue<number> | undefined; vertical?: | number | import('../types').SharedValue<number> | undefined; horizontal?: | number | import('../types').SharedValue<number> | undefined; } | { left: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { right: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { top: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | { bottom: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | null | undefined; activeCursor?: | import('../..').ActiveCursor | import('../types').SharedValue<import('../..').ActiveCursor> | undefined; mouseButton?: | import('../..').MouseButton | import('../types').SharedValue<import('../..').MouseButton> | undefined; cancelsTouchesInView?: | boolean | import('../types').SharedValue<boolean> | undefined; cancelsJSResponder?: | boolean | import('../types').SharedValue<boolean> | undefined; manualActivation?: | boolean | import('../types').SharedValue<boolean> | undefined; } & import('../types').GestureCallbacks< import('../hooks/gestures/native/NativeTypes').NativeHandlerData > & import('../hooks/gestures/native/NativeTypes').NativeGestureNativeProperties & import('../types').ExternalRelations & import('../types/NativeWrapperType').WrapperSpecificProperties<RNSwitch | null> ): React.JSX.Element; displayName: any;};variable TapGestureHandler
const TapGestureHandler: any;Deprecated
TapGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Tap()instead.
variable TextInput
const TextInput: { ( props: RNTextInputProps & { disableReanimated?: boolean | undefined; useAnimated?: boolean | undefined; testID?: string | undefined; } & { runOnJS?: boolean | import('../types').SharedValue<boolean> | undefined; enabled?: boolean | import('../types').SharedValue<boolean> | undefined; shouldCancelWhenOutside?: | boolean | import('../types').SharedValue<boolean> | undefined; hitSlop?: | number | import('../types').SharedValue<number> | import('../types').SharedValue<null> | { left?: | number | import('../types').SharedValue<number> | undefined; right?: | number | import('../types').SharedValue<number> | undefined; top?: | number | import('../types').SharedValue<number> | undefined; bottom?: | number | import('../types').SharedValue<number> | undefined; vertical?: | number | import('../types').SharedValue<number> | undefined; horizontal?: | number | import('../types').SharedValue<number> | undefined; } | { left: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { right: number | import('../types').SharedValue<number>; width: number | import('../types').SharedValue<number>; } | { top: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | { bottom: number | import('../types').SharedValue<number>; height: number | import('../types').SharedValue<number>; } | null | undefined; activeCursor?: | import('../..').ActiveCursor | import('../types').SharedValue<import('../..').ActiveCursor> | undefined; mouseButton?: | import('../..').MouseButton | import('../types').SharedValue<import('../..').MouseButton> | undefined; cancelsTouchesInView?: | boolean | import('../types').SharedValue<boolean> | undefined; cancelsJSResponder?: | boolean | import('../types').SharedValue<boolean> | undefined; manualActivation?: | boolean | import('../types').SharedValue<boolean> | undefined; } & import('../types').GestureCallbacks< import('../hooks/gestures/native/NativeTypes').NativeHandlerData > & import('../hooks/gestures/native/NativeTypes').NativeGestureNativeProperties & import('../types').ExternalRelations & import('../types/NativeWrapperType').WrapperSpecificProperties<RNTextInput | null> ): React.JSX.Element; displayName: any;};variable TouchableNativeFeedback
const TouchableNativeFeedback: any;Deprecated
TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
Functions
function BaseButton
BaseButton: (props: BaseButtonProps) => React.JSX.Element;Deprecated
BaseButtonis deprecated, useTouchableinstead
function BorderlessButton
BorderlessButton: (props: BorderlessButtonProps) => React.JSX.Element;Deprecated
BorderlessButtonis deprecated, useTouchablewithactiveOpacity={0.3}instead
function FlatList
FlatList: <ItemT = any>( props: PropsWithChildren< Omit<RNFlatListProps<ItemT>, 'renderScrollComponent' | 'ref'> & { disableReanimated?: boolean; useAnimated?: boolean; testID?: string; } & WithSharedValueRecursive< { runOnJS?: boolean; enabled?: boolean; shouldCancelWhenOutside?: boolean; hitSlop?: HitSlop; activeCursor?: ActiveCursor; mouseButton?: MouseButton; cancelsTouchesInView?: boolean; cancelsJSResponder?: boolean; manualActivation?: boolean; }, ActiveCursor | MouseButton > & GestureCallbacks<NativeHandlerData, NativeHandlerData> & NativeGestureNativeProperties & ExternalRelations & WrapperSpecificProperties<any> >) => ReactElement | null;function GestureDetector
GestureDetector: < TConfig, THandlerData, TExtendedHandlerData extends THandlerData>( props: | NativeDetectorProps<TConfig, THandlerData, TExtendedHandlerData> | LegacyGestureDetectorProps) => any;function GestureHandlerRootView
GestureHandlerRootView: ({ style, ...rest}: GestureHandlerRootViewProps) => React.JSX.Element;function InterceptingGestureDetector
InterceptingGestureDetector: < TConfig, THandlerData, TExtendedHandlerData extends THandlerData>({ gesture, children, touchAction, userSelect, enableContextMenu,}: InterceptingGestureDetectorProps< TConfig, THandlerData, TExtendedHandlerData>) => React.JSX.Element;function legacy_createNativeWrapper
legacy_createNativeWrapper: <P>( Component: React.ComponentType<P>, config?: Readonly<NativeViewGestureHandlerProps>) => { ( props: P & NativeViewGestureHandlerProps & { ref?: React.Ref<React.ComponentType<any> | null> | undefined; } ): React.JSX.Element; displayName: any;};Deprecated
createNativeWrapperis deprecated and will be removed in favor of usingGestureDetectorwithNativegesture directly.
function LegacyBaseButton
LegacyBaseButton: ({ ref, ...props}: Omit<LegacyBaseButtonProps, 'innerRef'> & { ref?: React.Ref<React.ComponentType<any>> | undefined;}) => React.JSX.Element;Deprecated
use
BaseButtoninstead
function LegacyBorderlessButton
LegacyBorderlessButton: ({ ref, ...props}: Omit<LegacyBorderlessButtonProps, 'innerRef'> & { ref?: React.Ref<React.ComponentType<any>> | undefined;}) => React.JSX.Element;Deprecated
use
BorderlessButtoninstead
function LegacyFlatList
LegacyFlatList: <ItemT>( props: PropsWithChildren< Omit<RNFlatListProps<ItemT>, 'renderScrollComponent'> & NativeViewGestureHandlerProps & { ref?: React.Ref<any> } >) => ReactElement | null;Deprecated
use
FlatListinstead
function LegacyPressable
LegacyPressable: (props: LegacyPressableProps) => React.JSX.Element;Deprecated
LegacyPressableis deprecated, usePressableinstead.
function LegacyRawButton
LegacyRawButton: ( props: Omit< React.ComponentProps<typeof LegacyRawButtonInner>, 'needsOffscreenAlphaCompositing' >) => React.JSX.Element;Deprecated
use
RawButtoninstead
function LegacyRectButton
LegacyRectButton: ({ ref, ...props}: Omit<LegacyRectButtonProps, 'innerRef'> & { ref?: React.Ref<React.ComponentType<any>> | undefined;}) => React.JSX.Element;Deprecated
use
RectButtoninstead
function LegacyScrollView
LegacyScrollView: ( props: RNScrollViewProps & NativeViewGestureHandlerProps & { ref?: React.Ref<RNScrollView | null> }) => React.JSX.Element;Deprecated
use
ScrollViewinstead
function LegacyText
LegacyText: (props: TextProps) => React.JSX.Element;Deprecated
LegacyTextis deprecated. Since Gesture Handler 3, you should wrapTextwithGestureDetector,InterceptingGestureDetector, orVirtualGestureDetector.
function Pressable
Pressable: (props: PressableProps) => React.JSX.Element;function RawButton
RawButton: (props: RawButtonProps) => React.JSX.Element;Deprecated
RawButtonis deprecated, useClickableinstead
function RectButton
RectButton: (props: RectButtonProps) => React.JSX.Element;Deprecated
RectButtonis deprecated, useTouchablewithactiveUnderlayOpacity={0.7}instead
function ScrollView
ScrollView: ( props: RNScrollViewProps & NativeWrapperProperties<RNScrollView | null>) => React.JSX.Element;function Touchable
Touchable: (props: TouchableProps) => React.JSX.Element;function TouchableWithoutFeedback
TouchableWithoutFeedback: ({ delayLongPress, extraButtonProps, ...rest}: PropsWithChildren<TouchableWithoutFeedbackProps> & { ref?: React.Ref<GenericTouchable>;}) => React.JSX.Element;Deprecated
TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
function useCompetingGestures
useCompetingGestures: ( ...gestures: AnyGesture[]) => import('../../types').ComposedGesture;function useExclusiveGestures
useExclusiveGestures: ( ...gestures: AnyGesture[]) => import('../../types').ComposedGesture;function useFlingGesture
useFlingGesture: (config?: FlingGestureConfig) => FlingGesture;function useHoverGesture
useHoverGesture: (config?: HoverGestureConfig) => HoverGesture;function useLongPressGesture
useLongPressGesture: (config?: LongPressGestureConfig) => LongPressGesture;function useManualGesture
useManualGesture: (config?: ManualGestureConfig) => ManualGesture;function useNativeGesture
useNativeGesture: (config?: NativeGestureConfig) => NativeGesture;function usePanGesture
usePanGesture: (config?: PanGestureConfig) => PanGesture;function usePinchGesture
usePinchGesture: (config?: PinchGestureConfig) => PinchGesture;function useRotationGesture
useRotationGesture: (config?: RotationGestureConfig) => RotationGesture;function useSimultaneousGestures
useSimultaneousGestures: ( ...gestures: AnyGesture[]) => import('../../types').ComposedGesture;function useTapGesture
useTapGesture: (config?: TapGestureConfig) => TapGesture;function VirtualGestureDetector
VirtualGestureDetector: < TConfig, THandlerData, TExtendedHandlerData extends THandlerData>( props: VirtualDetectorProps<TConfig, THandlerData, TExtendedHandlerData>) => any;Classes
class TouchableHighlight
class TouchableHighlight extends Component<TouchableHighlightProps, State> {}Deprecated
TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
TouchableHighlight follows RN's implementation
constructor
constructor(props: any);property defaultProps
static defaultProps: { activeOpacity: number; delayPressOut: number; underlayColor: string; delayLongPress: number; extraButtonProps: { rippleColor: string; exclusive: boolean };};property hasPressHandler
hasPressHandler: () => ((event: any) => void) & (() => void);property hideUnderlay
hideUnderlay: () => void;property onStateChange
onStateChange: (_from: number, to: number) => void;property showUnderlay
showUnderlay: () => void;method render
render: () => React.JSX.Element;method renderChildren
renderChildren: () => React.JSX.Element;class TouchableOpacity
class TouchableOpacity extends Component<TouchableOpacityProps> {}Deprecated
TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
TouchableOpacity bases on timing animation which has been used in RN's core
property defaultProps
static defaultProps: { activeOpacity: number; delayLongPress: number; extraButtonProps: { rippleColor: string; exclusive: boolean };};property getChildStyleOpacityWithDefault
getChildStyleOpacityWithDefault: () => number;property onStateChange
onStateChange: (_from: number, to: number) => void;property opacity
opacity: Animated.Value;property setOpacityTo
setOpacityTo: (value: number, duration: number) => void;method render
render: () => React.JSX.Element;Interfaces
interface BaseButtonProps
interface BaseButtonProps extends RawButtonProps {}Deprecated
BaseButtonPropsis deprecated, useClickablePropsinstead
property delayLongPress
delayLongPress?: number | undefined;Delay, in milliseconds, after which the
onLongPresscallback gets called. Defaults to 600.
property onActiveStateChange
onActiveStateChange?: ((active: boolean) => void) | undefined;Called when button changes from inactive to active and vice versa. It passes active state as a boolean variable as a first parameter for that method.
property onLongPress
onLongPress?: (() => void) | undefined;Called when the button gets pressed and is held for
delayLongPressmilliseconds.
property onPress
onPress?: ((pointerInside: boolean) => void) | undefined;Called when the button gets pressed (analogous to
onPressinTouchableHighlightfrom RN core).
property style
style?: StyleProp<ViewStyle>;interface BorderlessButtonProps
interface BorderlessButtonProps extends BaseButtonProps {}Deprecated
BorderlessButtonPropsis deprecated, useClickablePropsinstead
property activeOpacity
activeOpacity?: number | undefined;iOS only.
Opacity applied to the button when it is in an active state.
interface FlingGestureHandlerProps
interface FlingGestureHandlerProps extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>, FlingGestureConfig {}Deprecated
FlingGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Fling()instead.
interface ForceTouchGestureHandlerProps
interface ForceTouchGestureHandlerProps extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>, ForceTouchGestureConfig {}Deprecated
ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.ForceTouch()instead.
interface GestureEvent
interface GestureEvent<ExtraEventPayloadT = Record<string, unknown>> {}property nativeEvent
nativeEvent: Readonly<GestureEventPayload & ExtraEventPayloadT>;interface GestureEventPayload
interface GestureEventPayload {}property handlerTag
handlerTag: number;property numberOfPointers
numberOfPointers: number;property pointerType
pointerType: PointerType;property state
state: ValueOf<typeof State>;interface HandlerStateChangeEvent
interface HandlerStateChangeEvent<ExtraEventPayloadT = Record<string, unknown>> {}property nativeEvent
nativeEvent: Readonly<HandlerStateChangeEventPayload & ExtraEventPayloadT>;interface HandlerStateChangeEventPayload
interface HandlerStateChangeEventPayload extends GestureEventPayload {}property oldState
oldState: ValueOf<typeof State>;interface LegacyBaseButtonProps
interface LegacyBaseButtonProps extends LegacyRawButtonProps {}Deprecated
use
BaseButtonPropswithBaseButtoninstead
property delayLongPress
delayLongPress?: number | undefined;Delay, in milliseconds, after which the
onLongPresscallback gets called. Defaults to 600.
property onActiveStateChange
onActiveStateChange?: ((active: boolean) => void) | undefined;Called when button changes from inactive to active and vice versa. It passes active state as a boolean variable as a first parameter for that method.
property onLongPress
onLongPress?: (() => void) | undefined;Called when the button gets pressed and is held for
delayLongPressmilliseconds.
property onPress
onPress?: ((pointerInside: boolean) => void) | undefined;Called when the button gets pressed (analogous to
onPressinTouchableHighlightfrom RN core).
property style
style?: StyleProp<ViewStyle>;property testID
testID?: string | undefined;interface LegacyBorderlessButtonProps
interface LegacyBorderlessButtonProps extends LegacyBaseButtonProps {}Deprecated
use
BorderlessButtonPropswithBorderlessButtoninstead
property activeOpacity
activeOpacity?: number | undefined;iOS only.
Opacity applied to the button when it is in an active state.
interface LegacyGestureStateManager
interface GestureStateManagerType {}Deprecated
LegacyGestureStateManagerTypeis deprecated and will be removed in the future. Please use the new, hook-based API instead.
interface LegacyPressableProps
interface LegacyPressableProps extends Omit<CommonPressableProps, 'needsOffscreenAlphaCompositing'> {}property blocksExternalGesture
blocksExternalGesture?: RelationPropType;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
property requireExternalGestureToFail
requireExternalGestureToFail?: RelationPropType;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
property simultaneousWithExternalGesture
simultaneousWithExternalGesture?: RelationPropType;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
interface LegacyRawButtonProps
interface LegacyRawButtonProps extends NativeViewGestureHandlerProps, AccessibilityProps {}Deprecated
use
RawButtonPropswithRawButtoninstead
property borderless
borderless?: boolean | undefined;Android only.
Set this to true if you want the ripple animation to render outside the view bounds.
property exclusive
exclusive?: boolean | undefined;Defines if more than one button could be pressed simultaneously. By default set true.
property foreground
foreground?: boolean | undefined;Android only.
Defines whether the ripple animation should be drawn on the foreground of the view.
property onLayout
onLayout?: (event: LayoutChangeEvent) => void;Invoked on mount and layout changes.
property rippleColor
rippleColor?: number | ColorValue | null | undefined;Android only.
Defines color of native ripple animation used since API level 21.
property rippleRadius
rippleRadius?: number | null | undefined;Android only.
Defines radius of native ripple animation used since API level 21.
property style
style?: StyleProp<ViewStyle>;Style object, use it to set additional styles.
property testOnly_onLongPress
testOnly_onLongPress?: Function | null | undefined;Used for testing-library compatibility, not passed to the native component.
Deprecated
test-only props are deprecated and will be removed in the future.
property testOnly_onPress
testOnly_onPress?: Function | null | undefined;Used for testing-library compatibility, not passed to the native component.
Deprecated
test-only props are deprecated and will be removed in the future.
property testOnly_onPressIn
testOnly_onPressIn?: Function | null | undefined;Used for testing-library compatibility, not passed to the native component.
Deprecated
test-only props are deprecated and will be removed in the future.
property testOnly_onPressOut
testOnly_onPressOut?: Function | null | undefined;Used for testing-library compatibility, not passed to the native component.
Deprecated
test-only props are deprecated and will be removed in the future.
property touchSoundDisabled
touchSoundDisabled?: boolean | undefined;Android only.
Set this to true if you don't want the system to play sound when the button is pressed.
interface LegacyRectButtonProps
interface LegacyRectButtonProps extends LegacyBaseButtonProps {}Deprecated
use
RectButtonPropswithRectButtoninstead
property activeOpacity
activeOpacity?: number | undefined;iOS only.
Opacity applied to the underlay when button is in active state.
property underlayColor
underlayColor?: string | undefined;Background color that will be dimmed when button is in active state.
interface LongPressGestureHandlerProps
interface LongPressGestureHandlerProps extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>, LongPressGestureConfig {}Deprecated
LongPressGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.LongPress()instead.
interface NativeViewGestureHandlerProps
interface NativeViewGestureHandlerProps extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>, NativeViewGestureConfig {}Deprecated
NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Native()instead.
interface PanGestureHandlerProps
interface PanGestureHandlerProps extends BaseGestureHandlerProps<PanGestureHandlerEventPayload>, CommonPanProperties {}Deprecated
PanGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pan()instead.
property activeOffsetX
activeOffsetX?: number | [activeOffsetXStart: number, activeOffsetXEnd: number];Range along X axis (in points) where fingers travels without activation of handler. Moving outside of this range implies activation of handler. Range can be given as an array or a single number. If range is set as an array, first value must be lower or equal to 0, a the second one higher or equal to 0. If only one number
pis given a range of(-inf, p)will be used ifpis higher or equal to 0 and(-p, inf)otherwise.
property activeOffsetY
activeOffsetY?: number | [activeOffsetYStart: number, activeOffsetYEnd: number];Range along X axis (in points) where fingers travels without activation of handler. Moving outside of this range implies activation of handler. Range can be given as an array or a single number. If range is set as an array, first value must be lower or equal to 0, a the second one higher or equal to 0. If only one number
pis given a range of(-inf, p)will be used ifpis higher or equal to 0 and(-p, inf)otherwise.
property failOffsetX
failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number];When the finger moves outside this range (in points) along X axis and handler hasn't yet activated it will fail recognizing the gesture. Range can be given as an array or a single number. If range is set as an array, first value must be lower or equal to 0, a the second one higher or equal to 0. If only one number
pis given a range of(-inf, p)will be used ifpis higher or equal to 0 and(-p, inf)otherwise.
property failOffsetY
failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number];When the finger moves outside this range (in points) along Y axis and handler hasn't yet activated it will fail recognizing the gesture. Range can be given as an array or a single number. If range is set as an array, first value must be lower or equal to 0, a the second one higher or equal to 0. If only one number
pis given a range of(-inf, p)will be used ifpis higher or equal to 0 and(-p, inf)otherwise.
interface PinchGestureHandlerProps
interface PinchGestureHandlerProps extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {}Deprecated
PinchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pinch()instead.
interface PressableProps
interface PressableProps extends CommonPressableProps {}property block
block?: AnyGesture;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
property requireToFail
requireToFail?: AnyGesture;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
property simultaneousWith
simultaneousWith?: AnyGesture;A gesture object or an array of gesture objects containing the configuration and callbacks to be used with the Pressable's gesture handlers.
interface RawButtonProps
interface RawButtonProps extends Omit< ButtonProps, | 'defaultOpacity' | 'defaultScale' | 'defaultUnderlayOpacity' | 'activeOpacity' | 'activeScale' | 'activeUnderlayOpacity' | 'needsOffscreenAlphaCompositing' >, Omit< NativeWrapperProperties<React.ComponentRef<typeof GestureHandlerButton>>, 'hitSlop' | 'enabled' > {}Deprecated
RawButtonPropsis deprecated, useClickablePropsinstead
interface RectButtonProps
interface RectButtonProps extends BaseButtonProps {}Deprecated
RectButtonPropsis deprecated, useClickablePropsinstead
property activeOpacity
activeOpacity?: number | undefined;iOS only.
Opacity applied to the underlay when button is in active state.
property underlayColor
underlayColor?: string | undefined;Background color that will be dimmed when button is in active state.
interface RotationGestureHandlerProps
interface RotationGestureHandlerProps extends BaseGestureHandlerProps<RotationGestureHandlerEventPayload> {}Deprecated
RotationGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Rotation()instead.
interface TapGestureHandlerProps
interface TapGestureHandlerProps extends BaseGestureHandlerProps<TapGestureHandlerEventPayload>, TapGestureConfig {}Deprecated
TapGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Tap()instead.
Enums
enum GestureDetectorType
enum GestureDetectorType { Native = 0, Virtual = 1, Intercepting = 2,}enum HoverEffect
enum HoverEffect { NONE = 0, LIFT = 1, HIGHLIGHT = 2,}enum MouseButton
enum MouseButton { LEFT = 1, RIGHT = 2, MIDDLE = 4, BUTTON_4 = 8, BUTTON_5 = 16, ALL = 31,}Type Aliases
type ActiveCursor
type ActiveCursor = | 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out';type ComposedGesture
type ComposedGesture = { handlerTags: number[]; type: ComposedGestureName; config: ComposedGestureConfig; detectorCallbacks: DetectorCallbacks<unknown, unknown>; externalSimultaneousHandlers: number[]; gestures: Gesture[];};type Directions
type Directions = (typeof Directions)[keyof typeof Directions];type FlatList
type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;type FlingGesture
type FlingGesture = SingleGesture<FlingGestureProperties, FlingHandlerData>;type FlingGestureActiveEvent
type FlingGestureActiveEvent = FlingGestureEvent;type FlingGestureConfig
type FlingGestureConfig = ExcludeInternalConfigProps<FlingGestureInternalConfig>;type FlingGestureEvent
type FlingGestureEvent = GestureEvent<FlingHandlerData>;type FlingGestureHandler
type FlingGestureHandler = typeof FlingGestureHandler;Deprecated
FlingGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Fling()instead.
type FlingGestureHandlerEventPayload
type FlingGestureHandlerEventPayload = { x: number; y: number; absoluteX: number; absoluteY: number;};type FlingGestureHandlerGestureEvent
type FlingGestureHandlerGestureEvent = GestureEvent<FlingGestureHandlerEventPayload>;type FlingGestureHandlerProperties
type FlingGestureHandlerProperties = FlingGestureHandlerProps;type FlingGestureHandlerStateChangeEvent
type FlingGestureHandlerStateChangeEvent = HandlerStateChangeEvent<FlingGestureHandlerEventPayload>;type ForceTouchGestureChangeEventPayload
type ForceTouchGestureChangeEventPayload = { forceChange: number;};Deprecated
ForceTouchGestureChangeEventPayloadis deprecated and will be removed in the future.
type ForceTouchGestureHandler
type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & { forceTouchAvailable: boolean;};Deprecated
ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.ForceTouch()instead.
type ForceTouchGestureHandlerEventPayload
type ForceTouchGestureHandlerEventPayload = { x: number; y: number; absoluteX: number; absoluteY: number; /** * The pressure of a touch. */ force: number;};Deprecated
ForceTouch gesture is deprecated and will be removed in the future.
type ForceTouchGestureHandlerGestureEvent
type ForceTouchGestureHandlerGestureEvent = GestureEvent<ForceTouchGestureHandlerEventPayload>;Deprecated
ForceTouchGestureHandler is deprecated and will be removed in the future.
type ForceTouchGestureHandlerProperties
type ForceTouchGestureHandlerProperties = ForceTouchGestureHandlerProps;Deprecated
ForceTouch gesture is deprecated and will be removed in the future.
type ForceTouchGestureHandlerStateChangeEvent
type ForceTouchGestureHandlerStateChangeEvent = HandlerStateChangeEvent<ForceTouchGestureHandlerEventPayload>;Deprecated
ForceTouchGestureHandler is deprecated and will be removed in the future.
type GestureDetectorProps
type GestureDetectorProps< TConfig, THandlerData, TExtendedHandlerData extends THandlerData> = | NativeDetectorProps<TConfig, THandlerData, TExtendedHandlerData> | InterceptingGestureDetectorProps<TConfig, THandlerData, TExtendedHandlerData> | LegacyDetectorProps;type GestureHandlerGestureEvent
type GestureHandlerGestureEvent = GestureEvent;type GestureHandlerGestureEventNativeEvent
type GestureHandlerGestureEventNativeEvent = GestureEventPayload;type GestureHandlerStateChangeEvent
type GestureHandlerStateChangeEvent = HandlerStateChangeEvent;type GestureHandlerStateChangeNativeEvent
type GestureHandlerStateChangeNativeEvent = HandlerStateChangeEventPayload;type GestureStateChangeEvent
type GestureStateChangeEvent< GestureStateChangeEventPayloadT = Record<string, unknown>> = HandlerStateChangeEventPayload & GestureStateChangeEventPayloadT;type GestureTouchEvent
type GestureTouchEvent = { handlerTag: number; numberOfTouches: number; state: ValueOf<typeof State>; eventType: TouchEventType; allTouches: TouchData[]; changedTouches: TouchData[]; pointerType: PointerType;};type GestureType
type GestureType = | BaseGesture<Record<string, unknown>> | BaseGesture<Record<string, never>> | BaseGesture<TapGestureHandlerEventPayload> | BaseGesture<PanGestureHandlerEventPayload> | BaseGesture<LongPressGestureHandlerEventPayload> | BaseGesture<RotationGestureHandlerEventPayload> | BaseGesture<PinchGestureHandlerEventPayload> | BaseGesture<FlingGestureHandlerEventPayload> | BaseGesture<ForceTouchGestureHandlerEventPayload> | BaseGesture<NativeViewGestureHandlerPayload> | BaseGesture<HoverGestureHandlerEventPayload>;Deprecated
GestureTypeis deprecated and will be removed in the future. Please useSingleGestureinstead.
type GestureUpdateEvent
type GestureUpdateEvent<GestureEventPayloadT = Record<string, unknown>> = GestureEventPayload & GestureEventPayloadT;type HoverGesture
type HoverGesture = SingleGesture< HoverGestureInternalProperties, HoverHandlerData, HoverExtendedHandlerData>;type HoverGestureActiveEvent
type HoverGestureActiveEvent = GestureEvent<HoverExtendedHandlerData>;type HoverGestureConfig
type HoverGestureConfig = ExcludeInternalConfigProps< BaseGestureConfig< HoverGestureProperties, HoverHandlerData, HoverExtendedHandlerData >>;type HoverGestureEvent
type HoverGestureEvent = GestureEvent<HoverHandlerData>;type LegacyBaseButtonProperties
type LegacyBaseButtonProperties = LegacyBaseButtonProps;Deprecated
Use BaseButtonProperties instead
type LegacyBorderlessButtonProperties
type LegacyBorderlessButtonProperties = LegacyBorderlessButtonProps;Deprecated
Use BorderlessButtonProperties instead
type LegacyComposedGesture
type ComposedGestureType = InstanceType<typeof ComposedGesture>;Deprecated
ComposedGestureTypeis deprecated and will be removed in the future. Please useComposedGestureinstead.
type LegacyDrawerLayoutAndroid
type LegacyDrawerLayoutAndroid = typeof LegacyDrawerLayoutAndroid & RNDrawerLayoutAndroid;type LegacyExclusiveGesture
type ExclusiveGestureType = InstanceType<typeof ExclusiveGesture>;Deprecated
ExclusiveGestureTypeis deprecated and will be removed in the future. Please useComposedGestureinstead.
type LegacyFlatList
type LegacyFlatList<ItemT = any> = typeof LegacyFlatList & RNFlatList<ItemT>;type LegacyFlingGesture
type FlingGestureType = InstanceType<typeof FlingGesture>;Deprecated
FlingGestureTypeis deprecated and will be removed in the future. Please useFlingGestureinstead.
type LegacyForceTouchGesture
type ForceTouchGestureType = InstanceType<typeof ForceTouchGesture>;Deprecated
ForceTouchGestureTypeis deprecated and will be removed in the future.
type LegacyHoverGesture
type HoverGestureType = InstanceType<typeof HoverGesture>;Deprecated
HoverGestureTypeis deprecated and will be removed in the future. Please useHoverGestureinstead.
type LegacyLongPressGesture
type LongPressGestureType = InstanceType<typeof LongPressGesture>;Deprecated
LongPressGestureTypeis deprecated and will be removed in the future. Please useLongPressGestureinstead.
type LegacyManualGesture
type ManualGestureType = InstanceType<typeof ManualGesture>;Deprecated
ManualGestureTypeis deprecated and will be removed in the future. Please useManualGestureinstead.
type LegacyPanGesture
type PanGestureType = InstanceType<typeof PanGesture>;Deprecated
PanGestureTypeis deprecated and will be removed in the future. Please usePanGestureinstead.
type LegacyPinchGesture
type PinchGestureType = InstanceType<typeof PinchGesture>;Deprecated
PinchGestureTypeis deprecated and will be removed in the future. Please usePinchGestureinstead.
type LegacyRaceGesture
type RaceGestureType = ComposedGestureType;Deprecated
RaceGestureTypeis deprecated and will be removed in the future. Please useComposedGestureinstead.
type LegacyRawButtonProperties
type LegacyRawButtonProperties = LegacyRawButtonProps;Deprecated
Use RawButtonProperties instead
type LegacyRectButtonProperties
type LegacyRectButtonProperties = LegacyRectButtonProps;Deprecated
Use RectButtonProperties instead
type LegacyRefreshControl
type LegacyRefreshControl = typeof LegacyRefreshControl & RNRefreshControl;type LegacyRotationGesture
type RotationGestureType = InstanceType<typeof RotationGesture>;Deprecated
RotationGestureTypeis deprecated and will be removed in the future. Please useRotationGestureinstead.
type LegacyScrollView
type LegacyScrollView = typeof GHScrollView & RNScrollView;type LegacySimultaneousGesture
type SimultaneousGestureType = InstanceType<typeof SimultaneousGesture>;Deprecated
SimultaneousGestureTypeis deprecated and will be removed in the future. Please useComposedGestureinstead.
type LegacySwitch
type LegacySwitch = typeof LegacySwitch & RNSwitch;type LegacyTapGesture
type TapGestureType = InstanceType<typeof TapGesture>;Deprecated
TapGestureTypeis deprecated and will be removed in the future. Please useTapGestureinstead.
type LegacyText
type LegacyText = typeof LegacyText & RNText;Deprecated
LegacyTextis deprecated. Since Gesture Handler 3, you should wrapTextwithGestureDetector,InterceptingGestureDetector, orVirtualGestureDetector.
type LegacyTextInput
type LegacyTextInput = typeof LegacyTextInput & RNTextInput;type LongPressGesture
type LongPressGesture = SingleGesture< LongPressGestureProperties, LongPressHandlerData>;type LongPressGestureActiveEvent
type LongPressGestureActiveEvent = LongPressGestureEvent;type LongPressGestureConfig
type LongPressGestureConfig = ExcludeInternalConfigProps< BaseDiscreteGestureConfig<LongPressGestureProperties, LongPressHandlerData>>;type LongPressGestureEvent
type LongPressGestureEvent = GestureEvent<LongPressHandlerData>;type LongPressGestureHandler
type LongPressGestureHandler = typeof LongPressGestureHandler;Deprecated
LongPressGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.LongPress()instead.
type LongPressGestureHandlerEventPayload
type LongPressGestureHandlerEventPayload = { /** * X coordinate, expressed in points, of the current position of the pointer * (finger or a leading pointer when there are multiple fingers placed) * relative to the view attached to the handler. */ x: number; /** * Y coordinate, expressed in points, of the current position of the pointer * (finger or a leading pointer when there are multiple fingers placed) * relative to the view attached to the handler. */ y: number; /** * X coordinate, expressed in points, of the current position of the pointer * (finger or a leading pointer when there are multiple fingers placed) * relative to the window. It is recommended to use `absoluteX` instead of * `x` in cases when the view attached to the handler can be transformed as an * effect of the gesture. */ absoluteX: number; /** * Y coordinate, expressed in points, of the current position of the pointer * (finger or a leading pointer when there are multiple fingers placed) * relative to the window. It is recommended to use `absoluteY` instead of * `y` in cases when the view attached to the handler can be transformed as an * effect of the gesture. */ absoluteY: number; /** * Duration of the long press (time since the start of the event), expressed * in milliseconds. */ duration: number;};type LongPressGestureHandlerGestureEvent
type LongPressGestureHandlerGestureEvent = GestureEvent<LongPressGestureHandlerEventPayload>;type LongPressGestureHandlerProperties
type LongPressGestureHandlerProperties = LongPressGestureHandlerProps;type LongPressGestureHandlerStateChangeEvent
type LongPressGestureHandlerStateChangeEvent = HandlerStateChangeEvent<LongPressGestureHandlerEventPayload>;type ManualGesture
type ManualGesture = SingleGesture<ManualGestureProperties, ManualHandlerData>;type ManualGestureActiveEvent
type ManualGestureActiveEvent = ManualGestureEvent;type ManualGestureConfig
type ManualGestureConfig = ExcludeInternalConfigProps<ManualGestureInternalConfig>;type ManualGestureEvent
type ManualGestureEvent = GestureEvent<ManualHandlerData>;type NativeGesture
type NativeGesture = SingleGesture<NativeGestureProperties, NativeHandlerData>;type NativeGestureActiveEvent
type NativeGestureActiveEvent = NativeGestureEvent;type NativeGestureConfig
type NativeGestureConfig = ExcludeInternalConfigProps<NativeGestureInternalConfig>;type NativeGestureEvent
type NativeGestureEvent = GestureEvent<NativeHandlerData>;type NativeViewGestureHandler
type NativeViewGestureHandler = typeof NativeViewGestureHandler;Deprecated
NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Native()instead.
type NativeViewGestureHandlerGestureEvent
type NativeViewGestureHandlerGestureEvent = GestureEvent<NativeViewGestureHandlerPayload>;type NativeViewGestureHandlerPayload
type NativeViewGestureHandlerPayload = { /** * True if gesture was performed inside of containing view, false otherwise. */ pointerInside: boolean;};type NativeViewGestureHandlerProperties
type NativeViewGestureHandlerProperties = NativeViewGestureHandlerProps;type NativeViewGestureHandlerStateChangeEvent
type NativeViewGestureHandlerStateChangeEvent = HandlerStateChangeEvent<NativeViewGestureHandlerPayload>;type PanGesture
type PanGesture = SingleGesture< PanGestureInternalProperties, PanHandlerData, PanExtendedHandlerData>;type PanGestureActiveEvent
type PanGestureActiveEvent = GestureEvent<PanExtendedHandlerData>;type PanGestureChangeEventPayload
type PanGestureChangeEventPayload = { changeX: number; changeY: number;};Deprecated
PanGestureChangeEventPayloadis deprecated and will be removed in the future. Please usePanGestureActiveEventinstead.
type PanGestureConfig
type PanGestureConfig = ExcludeInternalConfigProps< BaseGestureConfig<PanGestureProperties, PanHandlerData, PanExtendedHandlerData>>;type PanGestureEvent
type PanGestureEvent = GestureEvent<PanHandlerData>;type PanGestureHandler
type PanGestureHandler = typeof PanGestureHandler;Deprecated
PanGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pan()instead.
type PanGestureHandlerEventPayload
type PanGestureHandlerEventPayload = { /** * X coordinate of the current position of the pointer (finger or a leading * pointer when there are multiple fingers placed) relative to the view * attached to the handler. Expressed in point units. */ x: number; /** * Y coordinate of the current position of the pointer (finger or a leading * pointer when there are multiple fingers placed) relative to the view * attached to the handler. Expressed in point units. */ y: number; /** * X coordinate of the current position of the pointer (finger or a leading * pointer when there are multiple fingers placed) relative to the window. * The value is expressed in point units. It is recommended to use it instead * of `x` in cases when the original view can be transformed as an effect of * the gesture. */ absoluteX: number; /** * Y coordinate of the current position of the pointer (finger or a leading * pointer when there are multiple fingers placed) relative to the window. * The value is expressed in point units. It is recommended to use it instead * of `y` in cases when the original view can be transformed as an * effect of the gesture. */ absoluteY: number; /** * Translation of the pan gesture along X axis accumulated over the time of * the gesture. The value is expressed in the point units. */ translationX: number; /** * Translation of the pan gesture along Y axis accumulated over the time of * the gesture. The value is expressed in the point units. */ translationY: number; /** * Velocity of the pan gesture along the X axis in the current moment. The * value is expressed in point units per second. */ velocityX: number; /** * Velocity of the pan gesture along the Y axis in the current moment. The * value is expressed in point units per second. */ velocityY: number; /** * Object containing additional stylus data. */ stylusData?: StylusData | undefined;};type PanGestureHandlerGestureEvent
type PanGestureHandlerGestureEvent = GestureEvent<PanGestureHandlerEventPayload>;type PanGestureHandlerProperties
type PanGestureHandlerProperties = PanGestureHandlerProps;type PanGestureHandlerStateChangeEvent
type PanGestureHandlerStateChangeEvent = HandlerStateChangeEvent<PanGestureHandlerEventPayload>;type PinchGesture
type PinchGesture = SingleGesture< PinchGestureProperties, PinchHandlerData, PinchExtendedHandlerData>;type PinchGestureActiveEvent
type PinchGestureActiveEvent = GestureEvent<PinchExtendedHandlerData>;type PinchGestureChangeEventPayload
type PinchGestureChangeEventPayload = { scaleChange: number;};Deprecated
PinchGestureChangeEventPayloadis deprecated and will be removed in the future. Please usePinchGestureActiveEventinstead.
type PinchGestureConfig
type PinchGestureConfig = ExcludeInternalConfigProps<PinchGestureInternalConfig>;type PinchGestureEvent
type PinchGestureEvent = GestureEvent<PinchHandlerData>;type PinchGestureHandler
type PinchGestureHandler = typeof PinchGestureHandler;Deprecated
PinchGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Pinch()instead.
type PinchGestureHandlerEventPayload
type PinchGestureHandlerEventPayload = { /** * The scale factor relative to the points of the two touches in screen * coordinates. */ scale: number; /** * Position expressed in points along X axis of center anchor point of * gesture. */ focalX: number; /** * Position expressed in points along Y axis of center anchor point of * gesture. */ focalY: number; /** * * Velocity of the pan gesture the current moment. The value is expressed in * point units per second. */ velocity: number;};type PinchGestureHandlerGestureEvent
type PinchGestureHandlerGestureEvent = GestureEvent<PinchGestureHandlerEventPayload>;type PinchGestureHandlerProperties
type PinchGestureHandlerProperties = PinchGestureHandlerProps;type PinchGestureHandlerStateChangeEvent
type PinchGestureHandlerStateChangeEvent = HandlerStateChangeEvent<PinchGestureHandlerEventPayload>;type PressableStateCallbackType
type PressableStateCallbackType = RNPressableStateCallbackType;type RefreshControl
type RefreshControl = typeof RefreshControl & RNRefreshControl;type RotationGesture
type RotationGesture = SingleGesture< RotationGestureProperties, RotationHandlerData, RotationExtendedHandlerData>;type RotationGestureActiveEvent
type RotationGestureActiveEvent = GestureEvent<RotationExtendedHandlerData>;type RotationGestureConfig
type RotationGestureConfig = ExcludeInternalConfigProps<RotationGestureInternalConfig>;type RotationGestureEvent
type RotationGestureEvent = GestureEvent<RotationHandlerData>;type RotationGestureHandler
type RotationGestureHandler = typeof RotationGestureHandler;Deprecated
RotationGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Rotation()instead.
type RotationGestureHandlerEventPayload
type RotationGestureHandlerEventPayload = { /** * Amount rotated, expressed in radians, from the gesture's focal point * (anchor). */ rotation: number; /** * X coordinate, expressed in points, of the gesture's central focal point * (anchor). */ anchorX: number; /** * Y coordinate, expressed in points, of the gesture's central focal point * (anchor). */ anchorY: number; /** * * Instantaneous velocity, expressed in point units per second, of the * gesture. */ velocity: number;};type RotationGestureHandlerGestureEvent
type RotationGestureHandlerGestureEvent = GestureEvent<RotationGestureHandlerEventPayload>;type RotationGestureHandlerProperties
type RotationGestureHandlerProperties = RotationGestureHandlerProps;type RotationGestureHandlerStateChangeEvent
type RotationGestureHandlerStateChangeEvent = HandlerStateChangeEvent<RotationGestureHandlerEventPayload>;type ScrollView
type ScrollView = typeof ScrollView & RNScrollView;type SingleGesture
type SingleGesture = | TapGesture | FlingGesture | LongPressGesture | PinchGesture | RotationGesture | HoverGesture | ManualGesture | NativeGesture | PanGesture;type SingleGestureEvent
type SingleGestureEvent = | TapGestureEvent | TapGestureActiveEvent | FlingGestureEvent | FlingGestureActiveEvent | LongPressGestureEvent | LongPressGestureActiveEvent | RotationGestureEvent | RotationGestureActiveEvent | HoverGestureEvent | HoverGestureActiveEvent | ManualGestureEvent | ManualGestureActiveEvent | NativeGestureEvent | NativeGestureActiveEvent | PanGestureEvent | PanGestureActiveEvent;type SingleGestureTouchEvent
type GestureTouchEvent = { handlerTag: number; numberOfTouches: number; state: ValueOf<typeof State>; eventType: TouchEventType; allTouches: TouchData[]; changedTouches: TouchData[]; pointerType: PointerType;};type State
type State = (typeof State)[keyof typeof State];type Switch
type Switch = typeof Switch & RNSwitch;type TapGesture
type TapGesture = DiscreteSingleGesture< TapGestureInternalProperties, TapHandlerData>;type TapGestureActiveEvent
type TapGestureActiveEvent = TapGestureEvent;type TapGestureConfig
type TapGestureConfig = ExcludeInternalConfigProps< BaseDiscreteGestureConfig<TapGestureProperties, TapHandlerData>>;type TapGestureEvent
type TapGestureEvent = GestureEvent<TapHandlerData>;type TapGestureHandler
type TapGestureHandler = typeof TapGestureHandler;Deprecated
TapGestureHandler will be removed in the future version of Gesture Handler. Use
Gesture.Tap()instead.
type TapGestureHandlerEventPayload
type TapGestureHandlerEventPayload = { x: number; y: number; absoluteX: number; absoluteY: number;};type TapGestureHandlerGestureEvent
type TapGestureHandlerGestureEvent = GestureEvent<TapGestureHandlerEventPayload>;type TapGestureHandlerProperties
type TapGestureHandlerProperties = TapGestureHandlerProps;type TapGestureHandlerStateChangeEvent
type TapGestureHandlerStateChangeEvent = HandlerStateChangeEvent<TapGestureHandlerEventPayload>;type TextInput
type TextInput = typeof TextInput & RNTextInput;type TouchableHighlightProps
type TouchableHighlightProps = RNTouchableHighlightProps & GenericTouchableProps;Deprecated
TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
type TouchableOpacityProps
type TouchableOpacityProps = RNTouchableOpacityProps & GenericTouchableProps & { useNativeAnimations?: boolean; };Deprecated
TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
type TouchableProps
type TouchableProps = Omit<ButtonProps, RippleProps | 'enabled' | DurationProps> & Omit< BaseButtonProps, keyof RawButtonProps | 'onActiveStateChange' | 'onPress' > & { /** * Press and hover animation durations, in milliseconds. Pass a single * number to apply it to every phase, or an object to customize per phase * and per category. Defaults to 50ms for the in phase and 100ms for the * out phase. */ animationDuration?: AnimationDuration | undefined; /** * Configuration for the ripple effect on Android. */ androidRipple?: PressableAndroidRippleConfig | undefined; /** * Called when the component gets pressed. */ onPress?: ((event: CallbackEventType) => void) | undefined; /** * Called when pointer touches the component. */ onPressIn?: ((event: CallbackEventType) => void) | undefined; /** * Called when pointer is released from the component. */ onPressOut?: ((event: CallbackEventType) => void) | undefined; /** * Whether the component should ignore touches. By default set to false. */ disabled?: boolean | undefined; /** * Whether the touch should be canceled when pointer leaves the component. By default set to true. * On web this prop doesn't have any effect and behaves as if `true` was set. */ cancelOnLeave?: boolean | undefined; };type TouchableWithoutFeedbackProps
type TouchableWithoutFeedbackProps = GenericTouchableProps;Deprecated
TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
type TouchData
type TouchData = { id: number; x: number; y: number; absoluteX: number; absoluteY: number;};Package Files (74)
- lib/typescript/Directions.d.ts
- lib/typescript/PointerType.d.ts
- lib/typescript/State.d.ts
- lib/typescript/components/GestureButtons.d.ts
- lib/typescript/components/GestureButtonsProps.d.ts
- lib/typescript/components/GestureComponents.d.ts
- lib/typescript/components/GestureHandlerRootView.d.ts
- lib/typescript/components/Pressable/Pressable.d.ts
- lib/typescript/components/Pressable/PressableProps.d.ts
- lib/typescript/components/Text.d.ts
- lib/typescript/components/touchables/TouchableHighlight.d.ts
- lib/typescript/components/touchables/TouchableNativeFeedback.d.ts
- lib/typescript/components/touchables/TouchableOpacity.d.ts
- lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts
- lib/typescript/handlers/FlingGestureHandler.d.ts
- lib/typescript/handlers/ForceTouchGestureHandler.d.ts
- lib/typescript/handlers/GestureHandlerEventPayload.d.ts
- lib/typescript/handlers/LongPressGestureHandler.d.ts
- lib/typescript/handlers/NativeViewGestureHandler.d.ts
- lib/typescript/handlers/PanGestureHandler.d.ts
- lib/typescript/handlers/PinchGestureHandler.d.ts
- lib/typescript/handlers/RotationGestureHandler.d.ts
- lib/typescript/handlers/TapGestureHandler.d.ts
- lib/typescript/handlers/createNativeWrapper.d.ts
- lib/typescript/handlers/gestureHandlerCommon.d.ts
- lib/typescript/handlers/gestureHandlerTypesCompat.d.ts
- lib/typescript/handlers/gestures/flingGesture.d.ts
- lib/typescript/handlers/gestures/forceTouchGesture.d.ts
- lib/typescript/handlers/gestures/gesture.d.ts
- lib/typescript/handlers/gestures/gestureComposition.d.ts
- lib/typescript/handlers/gestures/gestureObjects.d.ts
- lib/typescript/handlers/gestures/gestureStateManager.d.ts
- lib/typescript/handlers/gestures/hoverGesture.d.ts
- lib/typescript/handlers/gestures/longPressGesture.d.ts
- lib/typescript/handlers/gestures/manualGesture.d.ts
- lib/typescript/handlers/gestures/panGesture.d.ts
- lib/typescript/handlers/gestures/pinchGesture.d.ts
- lib/typescript/handlers/gestures/rotationGesture.d.ts
- lib/typescript/handlers/gestures/tapGesture.d.ts
- lib/typescript/index.d.ts
- lib/typescript/v3/components/GestureButtons.d.ts
- lib/typescript/v3/components/GestureButtonsProps.d.ts
- lib/typescript/v3/components/GestureComponents.d.ts
- lib/typescript/v3/components/Pressable.d.ts
- lib/typescript/v3/components/Touchable/Touchable.d.ts
- lib/typescript/v3/components/Touchable/TouchableProps.d.ts
- lib/typescript/v3/detectors/GestureDetector.d.ts
- lib/typescript/v3/detectors/VirtualDetector/InterceptingGestureDetector.d.ts
- lib/typescript/v3/detectors/VirtualDetector/VirtualDetector.d.ts
- lib/typescript/v3/detectors/common.d.ts
- lib/typescript/v3/gestureStateManager.d.ts
- lib/typescript/v3/hooks/composition/useCompetingGestures.d.ts
- lib/typescript/v3/hooks/composition/useExclusiveGestures.d.ts
- lib/typescript/v3/hooks/composition/useSimultaneousGestures.d.ts
- lib/typescript/v3/hooks/gestures/fling/FlingTypes.d.ts
- lib/typescript/v3/hooks/gestures/fling/useFlingGesture.d.ts
- lib/typescript/v3/hooks/gestures/hover/HoverTypes.d.ts
- lib/typescript/v3/hooks/gestures/hover/useHoverGesture.d.ts
- lib/typescript/v3/hooks/gestures/index.d.ts
- lib/typescript/v3/hooks/gestures/longPress/LongPressTypes.d.ts
- lib/typescript/v3/hooks/gestures/longPress/useLongPressGesture.d.ts
- lib/typescript/v3/hooks/gestures/manual/ManualTypes.d.ts
- lib/typescript/v3/hooks/gestures/manual/useManualGesture.d.ts
- lib/typescript/v3/hooks/gestures/native/NativeTypes.d.ts
- lib/typescript/v3/hooks/gestures/native/useNativeGesture.d.ts
- lib/typescript/v3/hooks/gestures/pan/PanTypes.d.ts
- lib/typescript/v3/hooks/gestures/pan/usePanGesture.d.ts
- lib/typescript/v3/hooks/gestures/pinch/PinchTypes.d.ts
- lib/typescript/v3/hooks/gestures/pinch/usePinchGesture.d.ts
- lib/typescript/v3/hooks/gestures/rotation/RotationTypes.d.ts
- lib/typescript/v3/hooks/gestures/rotation/useRotationGesture.d.ts
- lib/typescript/v3/hooks/gestures/tap/TapTypes.d.ts
- lib/typescript/v3/hooks/gestures/tap/useTapGesture.d.ts
- lib/typescript/v3/types/GestureTypes.d.ts
Dependencies (2)
Dev Dependencies (31)
- @babel/core
- @babel/preset-env
- @babel/preset-typescript
- @react-native/babel-preset
- @react-native/jest-preset
- @testing-library/react-native
- @types/invariant
- @types/jest
- @types/react
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- babel-plugin-module-resolver
- clang-format
- eslint
- eslint-config-satya164
- eslint-import-resolver-babel-module
- eslint-plugin-jest
- eslint-plugin-prettier
- eslint-plugin-react
- husky
- jest
- lint-staged
- madge
- prettier
- react
- react-native
- react-native-builder-bob
- react-native-reanimated
- react-native-worklets
- react-test-renderer
- typescript
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-native-gesture-handler.
- Markdown[](https://www.jsdocs.io/package/react-native-gesture-handler)
- HTML<a href="https://www.jsdocs.io/package/react-native-gesture-handler"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 9640 ms. - Missing or incorrect documentation? Open an issue for this package.
