Skip to content

Commit 70e2978

Browse files
authored
Fix callback props typings in various components (#1250)
1 parent f9a5871 commit 70e2978

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

generatedTypes/components/card/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export declare type CardProps = ViewProps & TouchableOpacityProps & {
2525
/**
2626
* action for when pressing the card
2727
*/
28-
onPress?: () => void;
28+
onPress?: TouchableOpacityProps['onPress'];
2929
/**
3030
* whether the card should have shadow or not
3131
*/
@@ -83,7 +83,7 @@ declare const _default: React.ComponentClass<ViewProps & TouchableOpacityProps &
8383
/**
8484
* action for when pressing the card
8585
*/
86-
onPress?: (() => void) | undefined;
86+
onPress?: ((props?: any) => void) | undefined;
8787
/**
8888
* whether the card should have shadow or not
8989
*/

generatedTypes/components/modal/TopBar.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface ModalTopBarProps {
2626
/**
2727
* done action callback
2828
*/
29-
onDone?: (props: any) => void;
29+
onDone?: (props?: any) => void;
3030
/**
3131
* cancel action props (Button props)
3232
*/
@@ -42,7 +42,7 @@ export interface ModalTopBarProps {
4242
/**
4343
* cancel action callback
4444
*/
45-
onCancel?: (props: any) => void;
45+
onCancel?: (props?: any) => void;
4646
/**
4747
* whether to include status bar or not (height claculations)
4848
*/

generatedTypes/components/touchableOpacity/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'st
3030
*/
3131
customValue?: any;
3232
style?: StyleProp<ViewStyle> | Animated.AnimatedProps<StyleProp<ViewStyle>>;
33-
onPress?: (props: TouchableOpacityProps | any) => void;
33+
onPress?: (props?: TouchableOpacityProps | any) => void;
3434
}
3535
declare const _default: React.ComponentClass<TouchableOpacityProps & {
3636
useCustomTheme?: boolean | undefined;

src/components/card/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type CardProps = ViewProps &
5656
/**
5757
* action for when pressing the card
5858
*/
59-
onPress?: () => void;
59+
onPress?: TouchableOpacityProps['onPress'];
6060
/**
6161
* whether the card should have shadow or not
6262
*/

src/components/modal/TopBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface ModalTopBarProps {
3232
/**
3333
* done action callback
3434
*/
35-
onDone?: (props: any) => void;
35+
onDone?: (props?: any) => void;
3636
/**
3737
* cancel action props (Button props)
3838
*/
@@ -48,7 +48,7 @@ export interface ModalTopBarProps {
4848
/**
4949
* cancel action callback
5050
*/
51-
onCancel?: (props: any) => void;
51+
onCancel?: (props?: any) => void;
5252
/**
5353
* whether to include status bar or not (height claculations)
5454
*/

src/components/touchableOpacity/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'st
4444
*/
4545
customValue?: any;
4646
style?: StyleProp<ViewStyle> | Animated.AnimatedProps<StyleProp<ViewStyle>>;
47-
onPress?: (props: TouchableOpacityProps | any) => void;
47+
onPress?: (props?: TouchableOpacityProps | any) => void;
4848
}
4949

5050
type Props = BaseComponentInjectedProps &

0 commit comments

Comments
 (0)