diff --git a/src/handlers/createHandler.tsx b/src/handlers/createHandler.tsx index d33adefb43..a7e74ca5f5 100644 --- a/src/handlers/createHandler.tsx +++ b/src/handlers/createHandler.tsx @@ -5,8 +5,7 @@ import { DeviceEventEmitter, EmitterSubscription, } from 'react-native'; -// @ts-ignore - its taken straight from RN -import { customDirectEventTypes } from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry'; +import { customDirectEventTypes } from './customDirectEventTypes'; // @ts-ignore - it isn't typed by TS & don't have definitelyTyped types import deepEqual from 'lodash/isEqual'; import RNGestureHandlerModule from '../RNGestureHandlerModule'; diff --git a/src/handlers/customDirectEventTypes.ts b/src/handlers/customDirectEventTypes.ts new file mode 100644 index 0000000000..3848dac64c --- /dev/null +++ b/src/handlers/customDirectEventTypes.ts @@ -0,0 +1,2 @@ +// @ts-ignore - its taken straight from RN +export { customDirectEventTypes } from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry'; diff --git a/src/handlers/customDirectEventTypes.web.ts b/src/handlers/customDirectEventTypes.web.ts new file mode 100644 index 0000000000..b7867a663b --- /dev/null +++ b/src/handlers/customDirectEventTypes.web.ts @@ -0,0 +1,5 @@ +// customDirectEventTypes doesn't exist in react-native-web, therefore importing it +// directly in createHandler.tsx would end in crash. +const customDirectEventTypes = {}; + +export { customDirectEventTypes };