Skip to content

Commit 9e46a09

Browse files
meishuuyayvery
authored andcommitted
fix typescript
1 parent ae65fe5 commit 9e46a09

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, {
66
useRef,
77
useState,
88
} from 'react';
9-
import { ViewProps } from 'react-native';
9+
import type { ViewProps } from 'react-native';
1010
import Animated, {
1111
interpolate,
1212
Extrapolate,
@@ -160,6 +160,7 @@ const BottomSheetBackdropComponent = ({
160160
);
161161

162162
return pressBehavior !== 'none' ? (
163+
// @ts-ignore
163164
<TapGestureHandler onGestureEvent={gestureHandler}>
164165
{AnimatedView}
165166
</TapGestureHandler>

src/components/bottomSheetFooter/BottomSheetFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { memo, useCallback, useMemo } from 'react';
2-
import { LayoutChangeEvent } from 'react-native';
2+
import type { LayoutChangeEvent } from 'react-native';
33
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
44
import { KEYBOARD_STATE } from '../../constants';
55
import { useBottomSheetInternal } from '../../hooks';

src/components/bottomSheetModal/BottomSheetModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,29 @@ const BottomSheetModalComponent = forwardRef<
143143
}
144144
bottomSheetRef.current?.snapToPosition(...args);
145145
}, []);
146-
const handleExpand = useCallback<BottomSheetMethods['expand']>((...args) => {
146+
const handleExpand = useCallback<BottomSheetMethods['expand']>((...args: any[]) => {
147147
if (minimized.current) {
148148
return;
149149
}
150150
bottomSheetRef.current?.expand(...args);
151151
}, []);
152152
const handleCollapse = useCallback<BottomSheetMethods['collapse']>(
153-
(...args) => {
153+
(...args: any[]) => {
154154
if (minimized.current) {
155155
return;
156156
}
157157
bottomSheetRef.current?.collapse(...args);
158158
},
159159
[]
160160
);
161-
const handleClose = useCallback<BottomSheetMethods['close']>((...args) => {
161+
const handleClose = useCallback<BottomSheetMethods['close']>((...args: any[]) => {
162162
if (minimized.current) {
163163
return;
164164
}
165165
bottomSheetRef.current?.close(...args);
166166
}, []);
167167
const handleForceClose = useCallback<BottomSheetMethods['forceClose']>(
168-
(...args) => {
168+
(...args: any[]) => {
169169
if (minimized.current) {
170170
return;
171171
}

src/components/bottomSheetTextInput/BottomSheetTextInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const BottomSheetTextInputComponent = forwardRef<
2020

2121
//#region callbacks
2222
const handleOnFocus = useCallback(
23-
args => {
23+
(args: any) => {
2424
shouldHandleKeyboardEvents.value = true;
2525
if (onFocus) {
2626
onFocus(args);
@@ -29,7 +29,7 @@ const BottomSheetTextInputComponent = forwardRef<
2929
[onFocus, shouldHandleKeyboardEvents]
3030
);
3131
const handleOnBlur = useCallback(
32-
args => {
32+
(args: any) => {
3333
shouldHandleKeyboardEvents.value = false;
3434
if (onBlur) {
3535
onBlur(args);

src/hooks/useScrollableSetter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useCallback, useEffect } from 'react';
2-
import Animated from 'react-native-reanimated';
2+
import type Animated from 'react-native-reanimated';
33
import { useBottomSheetInternal } from './useBottomSheetInternal';
44
import { getRefNativeTag } from '../utilities/getRefNativeTag';
5-
import { SCROLLABLE_TYPE } from '../constants';
5+
import type { SCROLLABLE_TYPE } from '../constants';
66
import type { Scrollable } from '../types';
77

88
export const useScrollableSetter = (

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"resolveJsonModule": true,
2222
"skipLibCheck": true,
2323
"strict": true,
24-
"target": "esnext"
24+
"target": "esnext",
25+
"importsNotUsedAsValues": "error"
2526
},
2627
"exclude": ["example"],
2728
"include": ["src"]

0 commit comments

Comments
 (0)