Skip to content

Commit 9c7b8f1

Browse files
committed
Modifies event and flat list ref types.
Allows Typsecript to compile without errors
1 parent c7e482e commit 9c7b8f1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/WheelPicker.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const WheelPicker: React.FC<Props> = ({
125125
}
126126
}, [scrollIndex, onChange]);
127127

128-
const handleScroll = (event: Animated.EventConfig<NativeScrollEvent>) => {
128+
const handleScroll = (event: NativeSyntheticEvent<any>) => {
129129
if (Platform.OS === 'web') {
130130
const positionY = event.nativeEvent.contentOffset.y;
131131
const index = Math.round(positionY / itemHeight);
@@ -158,9 +158,8 @@ const WheelPicker: React.FC<Props> = ({
158158
[{ nativeEvent: { contentOffset: { y: scrollY } } }],
159159
{
160160
useNativeDriver: true,
161-
listener: (event: {
162-
nativeEvent: Animated.EventConfig<NativeScrollEvent>;
163-
}) => handleScroll(event),
161+
listener: (event: NativeSyntheticEvent<any>
162+
) => handleScroll(event),
164163
},
165164
)}
166165
onMomentumScrollEnd={handleMomentumScrollEnd}
@@ -193,4 +192,4 @@ const WheelPicker: React.FC<Props> = ({
193192
);
194193
};
195194

196-
export default WheelPicker;
195+
export default WheelPicker;

0 commit comments

Comments
 (0)