forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
facebook#22990 add RCTDatePickerNativeComponent types (facebook#23013)
Summary: Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change: Changelog: ---------- [iOS] [Changed] - As mentioned in facebook#22990, I have moved native components required by DatePickerIOS.ios.js into separate files and added Flow Typing. Pull Request resolved: facebook#23013 Differential Revision: D13697591 Pulled By: TheSavior fbshipit-source-id: 5aec5a2270cbfc708f3e3a67662abd8071f1333f
- Loading branch information
1 parent
cd7b0ec
commit ea9e0d4
Showing
2 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const requireNativeComponent = require('requireNativeComponent'); | ||
|
||
import type {SyntheticEvent} from 'CoreEventTypes'; | ||
import type {ViewProps} from 'ViewPropTypes'; | ||
import type {NativeComponent} from 'ReactNative'; | ||
|
||
type Event = SyntheticEvent< | ||
$ReadOnly<{| | ||
timestamp: number, | ||
|}>, | ||
>; | ||
|
||
type NativeProps = $ReadOnly<{| | ||
...ViewProps, | ||
date?: ?number, | ||
initialDate?: ?Date, | ||
locale?: ?string, | ||
maximumDate?: ?number, | ||
minimumDate?: ?number, | ||
minuteInterval?: ?(1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30), | ||
mode?: ?('date' | 'time' | 'datetime'), | ||
onChange?: ?(event: Event) => void, | ||
timeZoneOffsetInMinutes?: ?number, | ||
|}>; | ||
type RCTDatePickerNativeType = Class<NativeComponent<NativeProps>>; | ||
|
||
module.exports = ((requireNativeComponent( | ||
'RCTDatePicker', | ||
): any): RCTDatePickerNativeType); |