Skip to content

Commit

Permalink
Turn Flow strict mode on for DatePickerIOS (#22105)
Browse files Browse the repository at this point in the history
Summary:
Related to #22100

Turn Flow strict mode on for DatePickerIOS.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/DatePicker/DatePickerIOS.ios.js] - Flow strict mode
Pull Request resolved: #22105

Differential Revision: D12920939

Pulled By: TheSavior

fbshipit-source-id: aae5ca04d656abb1cf34168e12e44dd50f0a603c
  • Loading branch information
nissy-dev authored and facebook-github-bot committed Nov 5, 2018
1 parent 7b10a02 commit 3c0211b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Libraries/Components/DatePicker/DatePickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* This is a controlled component version of RCTDatePickerIOS
*
* @format
* @flow
* @flow strict-local
*/

'use strict';
Expand All @@ -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: number,
|}>,
>;

type Props = $ReadOnly<{|
...ViewProps,
Expand Down Expand Up @@ -154,7 +159,11 @@ class DatePickerIOS extends React.Component<Props> {
? props.initialDate.getTime()
: undefined
}
locale={props.locale ? props.locale : undefined}
locale={
props.locale != null && props.locale !== ''
? props.locale
: undefined
}
maximumDate={
props.maximumDate ? props.maximumDate.getTime() : undefined
}
Expand Down

0 comments on commit 3c0211b

Please sign in to comment.