diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index 7a5455e60..c089d9ea8 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -24,12 +24,26 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); +import type {ViewProps} from 'ViewPropTypes'; type DefaultProps = { mode: 'date' | 'time' | 'datetime', }; type Event = Object; +type Props = $ReadOnly<{| + ...ViewProps, + date?: ?Date, + initialDate?: ?Date, + locale?: ?string, + maximumDate?: ?Date, + minimumDate?: ?Date, + minuteInterval?: ?(1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30), + mode?: ?('date' | 'time' | 'datetime'), + onDateChange: (date: Date) => void, + timeZoneOffsetInMinutes?: ?number, +|}>; + /** * Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is * a controlled component, so you must hook in to the `onDateChange` callback @@ -37,7 +51,7 @@ type Event = Object; * the user's change will be reverted immediately to reflect `props.date` as the * source of truth. */ -const DatePickerIOS = createReactClass({ +const DatePickerIOS = ((createReactClass({ displayName: 'DatePickerIOS', // TOOD: Put a better type for _picker _picker: (undefined: ?$FlowFixMe), @@ -171,7 +185,7 @@ const DatePickerIOS = createReactClass({ ); }, -}); +}): any): React.ComponentType); const styles = StyleSheet.create({ datePickerIOS: {