Turn Flow strict mode on for DatePickerIOS (#22105)

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: https://github.com/facebook/react-native/pull/22105

Differential Revision: D12920939

Pulled By: TheSavior

fbshipit-source-id: aae5ca04d656abb1cf34168e12e44dd50f0a603c
This commit is contained in:
nd-02110114 2018-11-04 22:58:47 -08:00 committed by Facebook Github Bot
parent 7b10a028ca
commit 3c0211b61a
1 changed files with 12 additions and 3 deletions

View File

@ -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: number,
|}>,
>;
type Props = $ReadOnly<{|
...ViewProps,
@ -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
}