-
Notifications
You must be signed in to change notification settings - Fork 734
Fix callback props typings in various components #1250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'st | |
*/ | ||
customValue?: any; | ||
style?: StyleProp<ViewStyle> | Animated.AnimatedProps<StyleProp<ViewStyle>>; | ||
onPress?: (props: TouchableOpacityProps | any) => void; | ||
onPress?: (props?: TouchableOpacityProps | any) => void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What the reason we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm good point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, there was a reason for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I see now. make sense :) |
||
} | ||
declare const _default: React.ComponentClass<TouchableOpacityProps & { | ||
useCustomTheme?: boolean | undefined; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is typescript still make us use
| undefined
althoughonPress
is an optional?(We don't use it in
onCancel
andonDone
for example)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are looking at the generatedTypes file, this is how it generates the d.ts files apparently.
The source code doesn't have it