From e4e715bcae6b02d0c1648e2aebdfec2ce0109928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Thu, 12 Feb 2026 10:58:38 +0100 Subject: [PATCH 1/6] Fix types --- .../src/components/GestureHandlerButton.tsx | 108 +++++++++++++++-- .../src/v3/components/GestureButtonsProps.ts | 112 ++---------------- .../src/v3/components/GestureComponents.tsx | 39 +++--- .../src/v3/createNativeWrapper.tsx | 15 +-- .../src/v3/hooks/utils/propsWhiteList.ts | 4 +- .../src/v3/types/NativeWrapperType.ts | 14 ++- 6 files changed, 144 insertions(+), 148 deletions(-) diff --git a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx index 6e6e268903..4142ab6edb 100644 --- a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx +++ b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx @@ -1,16 +1,110 @@ -import { HostComponent, StyleSheet, View } from 'react-native'; -import type { RawButtonProps } from '../v3/components/GestureButtonsProps'; +import { + AccessibilityProps, + ColorValue, + HostComponent, + LayoutChangeEvent, + StyleProp, + StyleSheet, + View, + ViewProps, + ViewStyle, +} from 'react-native'; import RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent'; import RNGestureHandlerButtonWrapperNativeComponent from '../specs/RNGestureHandlerButtonWrapperNativeComponent'; import { useMemo } from 'react'; +export interface ButtonProps extends ViewProps, AccessibilityProps { + children?: React.ReactNode; + + /** + * Defines if buttons should respond to touches. By default set to true. + */ + enabled?: boolean; + + /** + * Defines if more than one button could be pressed simultaneously. By default + * set true. + */ + exclusive?: boolean; + // TODO: we should transform props in `createNativeWrapper` + /** + * Android only. + * + * Defines color of native ripple animation used since API level 21. + */ + rippleColor?: number | ColorValue | null; + + /** + * Android only. + * + * Defines radius of native ripple animation used since API level 21. + */ + rippleRadius?: number | null; + + /** + * Android only. + * + * Set this to true if you want the ripple animation to render outside the view bounds. + */ + borderless?: boolean; + + /** + * Android only. + * + * Defines whether the ripple animation should be drawn on the foreground of the view. + */ + foreground?: boolean; + + /** + * Android only. + * + * Set this to true if you don't want the system to play sound when the button is pressed. + */ + touchSoundDisabled?: boolean; + + /** + * Style object, use it to set additional styles. + */ + style?: StyleProp; + + /** + * Invoked on mount and layout changes. + */ + onLayout?: (event: LayoutChangeEvent) => void; + + /** + * Used for testing-library compatibility, not passed to the native component. + * @deprecated test-only props are deprecated and will be removed in the future. + */ + // eslint-disable-next-line @typescript-eslint/ban-types + testOnly_onPress?: Function | null; + + /** + * Used for testing-library compatibility, not passed to the native component. + * @deprecated test-only props are deprecated and will be removed in the future. + */ + // eslint-disable-next-line @typescript-eslint/ban-types + testOnly_onPressIn?: Function | null; + + /** + * Used for testing-library compatibility, not passed to the native component. + * @deprecated test-only props are deprecated and will be removed in the future. + */ + // eslint-disable-next-line @typescript-eslint/ban-types + testOnly_onPressOut?: Function | null; + + /** + * Used for testing-library compatibility, not passed to the native component. + * @deprecated test-only props are deprecated and will be removed in the future. + */ + // eslint-disable-next-line @typescript-eslint/ban-types + testOnly_onLongPress?: Function | null; +} + const ButtonComponent = - RNGestureHandlerButtonNativeComponent as HostComponent; + RNGestureHandlerButtonNativeComponent as HostComponent; -export default function GestureHandlerButton({ - style, - ...rest -}: RawButtonProps) { +export default function GestureHandlerButton({ style, ...rest }: ButtonProps) { const flattenedStyle = useMemo(() => StyleSheet.flatten(style), [style]); const { diff --git a/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts b/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts index 0f4f282d8f..406c7c2296 100644 --- a/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts +++ b/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts @@ -1,98 +1,15 @@ -import * as React from 'react'; -import { - AccessibilityProps, - ColorValue, - LayoutChangeEvent, - StyleProp, - ViewStyle, -} from 'react-native'; -import type { NativeViewGestureHandlerProps } from '../../handlers/NativeViewGestureHandler'; +import { StyleProp, ViewStyle } from 'react-native'; +import type { NativeWrapperProperties } from '../types/NativeWrapperType'; +import GestureHandlerButton, { + ButtonProps, +} from '../../components/GestureHandlerButton'; export interface RawButtonProps - extends NativeViewGestureHandlerProps, - AccessibilityProps { - /** - * Defines if more than one button could be pressed simultaneously. By default - * set true. - */ - exclusive?: boolean; - // TODO: we should transform props in `createNativeWrapper` - /** - * Android only. - * - * Defines color of native ripple animation used since API level 21. - */ - rippleColor?: number | ColorValue | null; - - /** - * Android only. - * - * Defines radius of native ripple animation used since API level 21. - */ - rippleRadius?: number | null; - - /** - * Android only. - * - * Set this to true if you want the ripple animation to render outside the view bounds. - */ - borderless?: boolean; - - /** - * Android only. - * - * Defines whether the ripple animation should be drawn on the foreground of the view. - */ - foreground?: boolean; - - /** - * Android only. - * - * Set this to true if you don't want the system to play sound when the button is pressed. - */ - touchSoundDisabled?: boolean; - - /** - * Style object, use it to set additional styles. - */ - style?: StyleProp; - - /** - * Invoked on mount and layout changes. - */ - onLayout?: (event: LayoutChangeEvent) => void; - - /** - * Used for testing-library compatibility, not passed to the native component. - * @deprecated test-only props are deprecated and will be removed in the future. - */ - // eslint-disable-next-line @typescript-eslint/ban-types - testOnly_onPress?: Function | null; - - /** - * Used for testing-library compatibility, not passed to the native component. - * @deprecated test-only props are deprecated and will be removed in the future. - */ - // eslint-disable-next-line @typescript-eslint/ban-types - testOnly_onPressIn?: Function | null; - - /** - * Used for testing-library compatibility, not passed to the native component. - * @deprecated test-only props are deprecated and will be removed in the future. - */ - // eslint-disable-next-line @typescript-eslint/ban-types - testOnly_onPressOut?: Function | null; - - /** - * Used for testing-library compatibility, not passed to the native component. - * @deprecated test-only props are deprecated and will be removed in the future. - */ - // eslint-disable-next-line @typescript-eslint/ban-types - testOnly_onLongPress?: Function | null; -} -interface ButtonWithRefProps { - ref?: React.RefObject; -} + extends ButtonProps, + Omit< + NativeWrapperProperties, + 'hitSlop' | 'enabled' + > {} export interface BaseButtonProps extends RawButtonProps { /** @@ -121,9 +38,6 @@ export interface BaseButtonProps extends RawButtonProps { */ delayLongPress?: number; } -export interface BaseButtonWithRefProps - extends BaseButtonProps, - ButtonWithRefProps {} export interface RectButtonProps extends BaseButtonProps { /** @@ -138,9 +52,6 @@ export interface RectButtonProps extends BaseButtonProps { */ activeOpacity?: number; } -export interface RectButtonWithRefProps - extends RectButtonProps, - ButtonWithRefProps {} export interface BorderlessButtonProps extends BaseButtonProps { /** @@ -150,6 +61,3 @@ export interface BorderlessButtonProps extends BaseButtonProps { */ activeOpacity?: number; } -export interface BorderlessButtonWithRefProps - extends BorderlessButtonProps, - ButtonWithRefProps {} diff --git a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx index 2a43af7b28..202fd7e620 100644 --- a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx +++ b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx @@ -1,9 +1,4 @@ -import React, { - PropsWithChildren, - ReactElement, - useState, - RefObject, -} from 'react'; +import React, { PropsWithChildren, ReactElement, useState } from 'react'; import { ScrollView as RNScrollView, ScrollViewProps as RNScrollViewProps, @@ -14,6 +9,7 @@ import { FlatList as RNFlatList, FlatListProps as RNFlatListProps, RefreshControl as RNRefreshControl, + RefreshControlProps as RNRefreshControlProps, } from 'react-native'; import createNativeWrapper from '../createNativeWrapper'; @@ -24,7 +20,10 @@ import { GestureDetectorType } from '../detectors'; import { NativeGesture } from '../hooks/gestures/native/useNativeGesture'; import { ghQueueMicrotask } from '../../ghQueueMicrotask'; -export const RefreshControl = createNativeWrapper( +export const RefreshControl = createNativeWrapper< + RNRefreshControl, + RNRefreshControlProps +>( RNRefreshControl, { disallowInterruption: true, @@ -36,7 +35,10 @@ export const RefreshControl = createNativeWrapper( // eslint-disable-next-line @typescript-eslint/no-redeclare export type RefreshControl = typeof RefreshControl & RNRefreshControl; -const GHScrollView = createNativeWrapper>( +const GHScrollView = createNativeWrapper< + RNScrollView | null, + PropsWithChildren +>( RNScrollView, { disallowInterruption: true, @@ -46,13 +48,7 @@ const GHScrollView = createNativeWrapper>( ); export const ScrollView = ( - props: RNScrollViewProps & - NativeWrapperProperties & { - ref?: React.RefObject; - onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( - gesture: NativeGesture - ) => void; - } + props: RNScrollViewProps & NativeWrapperProperties ) => { const { refreshControl, @@ -95,7 +91,7 @@ export const ScrollView = ( // eslint-disable-next-line @typescript-eslint/no-redeclare export type ScrollView = typeof ScrollView & RNScrollView; -export const Switch = createNativeWrapper(RNSwitch, { +export const Switch = createNativeWrapper(RNSwitch, { shouldCancelWhenOutside: false, shouldActivateOnStart: true, disallowInterruption: true, @@ -104,7 +100,9 @@ export const Switch = createNativeWrapper(RNSwitch, { // eslint-disable-next-line @typescript-eslint/no-redeclare export type Switch = typeof Switch & RNSwitch; -export const TextInput = createNativeWrapper(RNTextInput); +export const TextInput = createNativeWrapper( + RNTextInput +); // eslint-disable-next-line @typescript-eslint/no-redeclare export type TextInput = typeof TextInput & RNTextInput; @@ -175,12 +173,7 @@ export const FlatList = ((props) => { }) as ( props: PropsWithChildren< Omit, 'renderScrollComponent' | 'ref'> & - NativeWrapperProperties & { - ref?: RefObject | null>; - onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( - gesture: NativeGesture - ) => void; - } + NativeWrapperProperties | null> > ) => ReactElement | null; diff --git a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx index d92d6e75a3..4a324bb5f6 100644 --- a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx +++ b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx @@ -4,24 +4,15 @@ import { NativeWrapperProps } from './hooks/utils'; import { useNativeGesture } from './hooks/gestures'; import { NativeDetector } from './detectors/NativeDetector'; import type { NativeWrapperProperties } from './types/NativeWrapperType'; -import { NativeGesture } from './hooks/gestures/native/useNativeGesture'; import { GestureDetectorType, InterceptingGestureDetector } from './detectors'; import { VirtualDetector } from './detectors/VirtualDetector/VirtualDetector'; -export default function createNativeWrapper

( +export default function createNativeWrapper( Component: React.ComponentType

, - config: Readonly = {}, + config: Readonly> = {}, detectorType: GestureDetectorType = GestureDetectorType.Native ) { - const ComponentWrapper = ( - props: P & - NativeWrapperProperties & { - ref?: React.RefObject; - onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( - gesture: NativeGesture - ) => void; - } - ) => { + const ComponentWrapper = (props: P & NativeWrapperProperties) => { const { ref, onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER, ...restProps } = props; // Filter out props that should be passed to gesture handler wrapper diff --git a/packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts b/packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts index f3758bfd7b..1698bf9456 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts @@ -91,7 +91,9 @@ export const PropsWhiteLists = new Map< export const EMPTY_WHITE_LIST = new Set(); -export const NativeWrapperProps = new Set([ +export const NativeWrapperProps = new Set< + keyof NativeWrapperProperties +>([ ...CommonConfig, ...HandlerCallbacks, ...NativeHandlerNativeProperties, diff --git a/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts b/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts index e54792bcbe..a571aabb74 100644 --- a/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts +++ b/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts @@ -1,8 +1,16 @@ import { CommonGestureConfig, ExternalRelations, GestureCallbacks } from '.'; import { NativeGestureNativeProperties } from '../hooks/gestures/native/NativeProperties'; -import { NativeViewHandlerData } from '../hooks/gestures/native/useNativeGesture'; +import { + NativeGesture, + NativeViewHandlerData, +} from '../hooks/gestures/native/useNativeGesture'; -export type NativeWrapperProperties = CommonGestureConfig & +export type NativeWrapperProperties = CommonGestureConfig & GestureCallbacks & NativeGestureNativeProperties & - ExternalRelations; + ExternalRelations & { + ref?: React.RefObject; + onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( + gesture: NativeGesture + ) => void; + }; From 837fde49f8fed4bcda20588fefb96a7b0b5d08b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Thu, 12 Feb 2026 11:44:23 +0100 Subject: [PATCH 2/6] Copilot review --- .../src/v3/components/GestureButtonsProps.ts | 2 +- .../src/v3/createNativeWrapper.tsx | 9 +++++++-- .../src/v3/types/NativeWrapperType.ts | 17 ++++++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts b/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts index 406c7c2296..d5dc9e930a 100644 --- a/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts +++ b/packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts @@ -7,7 +7,7 @@ import GestureHandlerButton, { export interface RawButtonProps extends ButtonProps, Omit< - NativeWrapperProperties, + NativeWrapperProperties>, 'hitSlop' | 'enabled' > {} diff --git a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx index 4a324bb5f6..2b4046b08c 100644 --- a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx +++ b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx @@ -3,13 +3,18 @@ import React, { useEffect } from 'react'; import { NativeWrapperProps } from './hooks/utils'; import { useNativeGesture } from './hooks/gestures'; import { NativeDetector } from './detectors/NativeDetector'; -import type { NativeWrapperProperties } from './types/NativeWrapperType'; +import type { + NativeWrapperProperties, + WrapperSpecificProperties, +} from './types/NativeWrapperType'; import { GestureDetectorType, InterceptingGestureDetector } from './detectors'; import { VirtualDetector } from './detectors/VirtualDetector/VirtualDetector'; export default function createNativeWrapper( Component: React.ComponentType

, - config: Readonly> = {}, + config: Readonly< + Omit, keyof WrapperSpecificProperties> + > = {}, detectorType: GestureDetectorType = GestureDetectorType.Native ) { const ComponentWrapper = (props: P & NativeWrapperProperties) => { diff --git a/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts b/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts index a571aabb74..4b0543a3f2 100644 --- a/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts +++ b/packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts @@ -5,12 +5,15 @@ import { NativeViewHandlerData, } from '../hooks/gestures/native/useNativeGesture'; -export type NativeWrapperProperties = CommonGestureConfig & +export type WrapperSpecificProperties = { + ref?: React.RefObject; + onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( + gesture: NativeGesture + ) => void; +}; + +export type NativeWrapperProperties = CommonGestureConfig & GestureCallbacks & NativeGestureNativeProperties & - ExternalRelations & { - ref?: React.RefObject; - onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: ( - gesture: NativeGesture - ) => void; - }; + ExternalRelations & + WrapperSpecificProperties; From a230b5728f0975cbc8cd3a30039afa43f07c69de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Mon, 16 Feb 2026 09:55:58 +0100 Subject: [PATCH 3/6] Remove todo --- .../src/components/GestureHandlerButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx index 4142ab6edb..eef70ddb43 100644 --- a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx +++ b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx @@ -26,7 +26,7 @@ export interface ButtonProps extends ViewProps, AccessibilityProps { * set true. */ exclusive?: boolean; - // TODO: we should transform props in `createNativeWrapper` + /** * Android only. * From 25f2f52bc50b9762646eda55982859576c767171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Mon, 16 Feb 2026 09:56:26 +0100 Subject: [PATCH 4/6] Rename generic types --- .../src/v3/createNativeWrapper.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx index 2b4046b08c..28f6462652 100644 --- a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx +++ b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx @@ -10,14 +10,22 @@ import type { import { GestureDetectorType, InterceptingGestureDetector } from './detectors'; import { VirtualDetector } from './detectors/VirtualDetector/VirtualDetector'; -export default function createNativeWrapper( - Component: React.ComponentType

, +export default function createNativeWrapper< + RefType = unknown, + PropsType = unknown, +>( + Component: React.ComponentType, config: Readonly< - Omit, keyof WrapperSpecificProperties> + Omit< + NativeWrapperProperties, + keyof WrapperSpecificProperties + > > = {}, detectorType: GestureDetectorType = GestureDetectorType.Native ) { - const ComponentWrapper = (props: P & NativeWrapperProperties) => { + const ComponentWrapper = ( + props: PropsType & NativeWrapperProperties + ) => { const { ref, onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER, ...restProps } = props; // Filter out props that should be passed to gesture handler wrapper @@ -39,7 +47,7 @@ export default function createNativeWrapper( enabled: props.enabled, hitSlop: props.hitSlop, testID: props.testID, - } as P, + } as PropsType, } ); From 67f9cebcaf8be4e679485e7cef19163e9aedf9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Mon, 16 Feb 2026 10:16:27 +0100 Subject: [PATCH 5/6] Move null to createNativeWrapper --- .../src/v3/components/GestureComponents.tsx | 2 +- .../react-native-gesture-handler/src/v3/createNativeWrapper.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx index 202fd7e620..076a8020a8 100644 --- a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx +++ b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx @@ -36,7 +36,7 @@ export const RefreshControl = createNativeWrapper< export type RefreshControl = typeof RefreshControl & RNRefreshControl; const GHScrollView = createNativeWrapper< - RNScrollView | null, + RNScrollView, PropsWithChildren >( RNScrollView, diff --git a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx index 28f6462652..37e4134d59 100644 --- a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx +++ b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx @@ -24,7 +24,7 @@ export default function createNativeWrapper< detectorType: GestureDetectorType = GestureDetectorType.Native ) { const ComponentWrapper = ( - props: PropsType & NativeWrapperProperties + props: PropsType & NativeWrapperProperties ) => { const { ref, onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER, ...restProps } = props; From 5026e450890b76e8a0fff54773e8224e3fd64dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 17 Feb 2026 12:32:35 +0100 Subject: [PATCH 6/6] Rename generic types --- .../src/v3/createNativeWrapper.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx index 37e4134d59..139a56e59f 100644 --- a/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx +++ b/packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx @@ -10,21 +10,15 @@ import type { import { GestureDetectorType, InterceptingGestureDetector } from './detectors'; import { VirtualDetector } from './detectors/VirtualDetector/VirtualDetector'; -export default function createNativeWrapper< - RefType = unknown, - PropsType = unknown, ->( - Component: React.ComponentType, +export default function createNativeWrapper( + Component: React.ComponentType, config: Readonly< - Omit< - NativeWrapperProperties, - keyof WrapperSpecificProperties - > + Omit, keyof WrapperSpecificProperties> > = {}, detectorType: GestureDetectorType = GestureDetectorType.Native ) { const ComponentWrapper = ( - props: PropsType & NativeWrapperProperties + props: TProps & NativeWrapperProperties ) => { const { ref, onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER, ...restProps } = props; @@ -47,7 +41,7 @@ export default function createNativeWrapper< enabled: props.enabled, hitSlop: props.hitSlop, testID: props.testID, - } as PropsType, + } as TProps, } );