Skip to content

Commit 1a7aea1

Browse files
authored
Do not import NativeWrapperProps as type (#4030)
## Description Currently in `GestureComponents.tsx` we import `NativeWrapperProps` as `type`. However, in `FlatList` we need this as value to be able to [iterate over values](https://github.com/software-mansion/react-native-gesture-handler/blob/3918d8ae52020d6b64f31c2ae0b06b19b284c699/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx#L136). When imported as type, it crashes. ## Test plan <details> <summary>Tested on the following code:</summary> ```tsx import { Pressable as RNPressable, Text } from 'react-native'; import { GestureHandlerRootView, FlatList, Pressable, } from 'react-native-gesture-handler'; export default function TestComponent() { return ( <GestureHandlerRootView> <Text>RN</Text> <FlatList horizontal data={[1, 2, 3, 4, 5]} renderItem={() => ( <RNPressable style={{ borderWidth: 5, width: 50, height: 50, borderColor: 'black', }} /> )} /> <Text>RNGH</Text> <FlatList horizontal data={[1, 2, 3, 4, 5]} renderItem={() => ( <Pressable style={{ borderWidth: 5, width: 50, height: 50, borderColor: 'blue', }} /> )} /> </GestureHandlerRootView> ); } ``` </details>
1 parent bfb24af commit 1a7aea1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import createNativeWrapper from '../createNativeWrapper';
1616

1717
import type { NativeWrapperProperties } from '../types/NativeWrapperType';
18-
import type { NativeWrapperProps } from '../hooks/utils';
18+
import { NativeWrapperProps } from '../hooks/utils';
1919
import { GestureDetectorType } from '../detectors';
2020
import type { NativeGesture } from '../hooks/gestures/native/NativeTypes';
2121
import { ghQueueMicrotask } from '../../ghQueueMicrotask';

0 commit comments

Comments
 (0)