react-native-gesture-handler
Version:
Experimental implementation of a new declarative API for gesture handling in react-native
19 lines (15 loc) • 543 B
text/typescript
import { startListening } from './handlers/gestures/eventReceiver';
import RNGestureHandlerModule from './RNGestureHandlerModule';
import { isFabric } from './utils';
let fabricInitialized = false;
export function initialize() {
startListening();
}
// since isFabric() may give wrong results before the first render, we call this
// method during render of GestureHandlerRootView
export function maybeInitializeFabric() {
if (isFabric() && !fabricInitialized) {
RNGestureHandlerModule.install();
fabricInitialized = true;
}
}