Skip to content

Commit

Permalink
Flow Type DatePickerIOS.ios.js
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7978090

fbshipit-source-id: 65da360f34f4b6d9240a8343c89be66404767474
  • Loading branch information
elicwhite authored and facebook-github-bot committed May 12, 2018
1 parent 0b71d1d commit 97e572e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Libraries/Components/DatePicker/DatePickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,34 @@ 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
* and update the `date` prop in order for the component to update, otherwise
* 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),
Expand Down Expand Up @@ -171,7 +185,7 @@ const DatePickerIOS = createReactClass({
</View>
);
},
});
}): any): React.ComponentType<Props>);

const styles = StyleSheet.create({
datePickerIOS: {
Expand Down

0 comments on commit 97e572e

Please sign in to comment.