-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Turn Flow strict mode on for DatePickerIOS #22105
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 1 commit
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* This is a controlled component version of RCTDatePickerIOS | ||
* | ||
* @format | ||
* @flow | ||
* @flow strict-local | ||
*/ | ||
|
||
'use strict'; | ||
|
@@ -21,10 +21,15 @@ const View = require('View'); | |
const requireNativeComponent = require('requireNativeComponent'); | ||
|
||
import type {ViewProps} from 'ViewPropTypes'; | ||
import type {SyntheticEvent} from 'CoreEventTypes'; | ||
|
||
const RCTDatePickerIOS = requireNativeComponent('RCTDatePicker'); | ||
|
||
type Event = Object; | ||
type Event = SyntheticEvent< | ||
$ReadOnly<{| | ||
timestamp: string | number, | ||
|}>, | ||
>; | ||
|
||
type Props = $ReadOnly<{| | ||
...ViewProps, | ||
|
@@ -154,7 +159,7 @@ class DatePickerIOS extends React.Component<Props> { | |
? props.initialDate.getTime() | ||
: undefined | ||
} | ||
locale={props.locale ? props.locale : undefined} | ||
locale={props.locale} | ||
|
||
maximumDate={ | ||
props.maximumDate ? props.maximumDate.getTime() : undefined | ||
} | ||
|
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.
Could you link to the file(s) that shows that this is the type for
timestamp
from native?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.
It looks like
timestamp
can only be a number:react-native/React/Views/RCTDatePicker.m
Lines 32 to 37 in 1151c09
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.
OK! I fixed.