UNPKG

react-native-gesture-handler

Version:

Declarative API exposing native platform touch and gesture system to React Native

24 lines (18 loc) 606 B
import { createContext, use } from 'react'; import type { VirtualChild } from '../../types'; export enum InterceptingDetectorMode { DEFAULT, ANIMATED, REANIMATED, } export type InterceptingDetectorContextValue = { mode: InterceptingDetectorMode; setMode: (mode: InterceptingDetectorMode) => void; register: (child: VirtualChild) => void; unregister: (child: VirtualChild) => void; }; export const InterceptingDetectorContext = createContext<InterceptingDetectorContextValue | null>(null); export function useInterceptingDetectorContext() { return use(InterceptingDetectorContext); }