Skip to content

Commit

Permalink
fix typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
meishuu authored and yayvery committed Feb 24, 2024
1 parent ae65fe5 commit 9e46a09
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/components/bottomSheetBackdrop/BottomSheetBackdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
useRef,
useState,
} from 'react';
import { ViewProps } from 'react-native';
import type { ViewProps } from 'react-native';
import Animated, {
interpolate,
Extrapolate,
Expand Down Expand Up @@ -160,6 +160,7 @@ const BottomSheetBackdropComponent = ({
);

return pressBehavior !== 'none' ? (
// @ts-ignore
<TapGestureHandler onGestureEvent={gestureHandler}>
{AnimatedView}
</TapGestureHandler>
Expand Down
2 changes: 1 addition & 1 deletion src/components/bottomSheetFooter/BottomSheetFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { memo, useCallback, useMemo } from 'react';
import { LayoutChangeEvent } from 'react-native';
import type { LayoutChangeEvent } from 'react-native';
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
import { KEYBOARD_STATE } from '../../constants';
import { useBottomSheetInternal } from '../../hooks';
Expand Down
8 changes: 4 additions & 4 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,29 @@ const BottomSheetModalComponent = forwardRef<
}
bottomSheetRef.current?.snapToPosition(...args);
}, []);
const handleExpand = useCallback<BottomSheetMethods['expand']>((...args) => {
const handleExpand = useCallback<BottomSheetMethods['expand']>((...args: any[]) => {
if (minimized.current) {
return;
}
bottomSheetRef.current?.expand(...args);
}, []);
const handleCollapse = useCallback<BottomSheetMethods['collapse']>(
(...args) => {
(...args: any[]) => {
if (minimized.current) {
return;
}
bottomSheetRef.current?.collapse(...args);
},
[]
);
const handleClose = useCallback<BottomSheetMethods['close']>((...args) => {
const handleClose = useCallback<BottomSheetMethods['close']>((...args: any[]) => {
if (minimized.current) {
return;
}
bottomSheetRef.current?.close(...args);
}, []);
const handleForceClose = useCallback<BottomSheetMethods['forceClose']>(
(...args) => {
(...args: any[]) => {
if (minimized.current) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/bottomSheetTextInput/BottomSheetTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const BottomSheetTextInputComponent = forwardRef<

//#region callbacks
const handleOnFocus = useCallback(
args => {
(args: any) => {
shouldHandleKeyboardEvents.value = true;
if (onFocus) {
onFocus(args);
Expand All @@ -29,7 +29,7 @@ const BottomSheetTextInputComponent = forwardRef<
[onFocus, shouldHandleKeyboardEvents]
);
const handleOnBlur = useCallback(
args => {
(args: any) => {
shouldHandleKeyboardEvents.value = false;
if (onBlur) {
onBlur(args);
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useScrollableSetter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useCallback, useEffect } from 'react';
import Animated from 'react-native-reanimated';
import type Animated from 'react-native-reanimated';
import { useBottomSheetInternal } from './useBottomSheetInternal';
import { getRefNativeTag } from '../utilities/getRefNativeTag';
import { SCROLLABLE_TYPE } from '../constants';
import type { SCROLLABLE_TYPE } from '../constants';
import type { Scrollable } from '../types';

export const useScrollableSetter = (
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext"
"target": "esnext",
"importsNotUsedAsValues": "error"
},
"exclude": ["example"],
"include": ["src"]
Expand Down

0 comments on commit 9e46a09

Please sign in to comment.