Skip to content

Commit 97e572e

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Flow Type DatePickerIOS.ios.js
Reviewed By: yungsters Differential Revision: D7978090 fbshipit-source-id: 65da360f34f4b6d9240a8343c89be66404767474
1 parent 0b71d1d commit 97e572e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Libraries/Components/DatePicker/DatePickerIOS.ios.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,34 @@ const ViewPropTypes = require('ViewPropTypes');
2424
const createReactClass = require('create-react-class');
2525
const requireNativeComponent = require('requireNativeComponent');
2626

27+
import type {ViewProps} from 'ViewPropTypes';
2728
type DefaultProps = {
2829
mode: 'date' | 'time' | 'datetime',
2930
};
3031

3132
type Event = Object;
3233

34+
type Props = $ReadOnly<{|
35+
...ViewProps,
36+
date?: ?Date,
37+
initialDate?: ?Date,
38+
locale?: ?string,
39+
maximumDate?: ?Date,
40+
minimumDate?: ?Date,
41+
minuteInterval?: ?(1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30),
42+
mode?: ?('date' | 'time' | 'datetime'),
43+
onDateChange: (date: Date) => void,
44+
timeZoneOffsetInMinutes?: ?number,
45+
|}>;
46+
3347
/**
3448
* Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is
3549
* a controlled component, so you must hook in to the `onDateChange` callback
3650
* and update the `date` prop in order for the component to update, otherwise
3751
* the user's change will be reverted immediately to reflect `props.date` as the
3852
* source of truth.
3953
*/
40-
const DatePickerIOS = createReactClass({
54+
const DatePickerIOS = ((createReactClass({
4155
displayName: 'DatePickerIOS',
4256
// TOOD: Put a better type for _picker
4357
_picker: (undefined: ?$FlowFixMe),
@@ -171,7 +185,7 @@ const DatePickerIOS = createReactClass({
171185
</View>
172186
);
173187
},
174-
});
188+
}): any): React.ComponentType<Props>);
175189

176190
const styles = StyleSheet.create({
177191
datePickerIOS: {

0 commit comments

Comments
 (0)