[react-native] Added initialDate to DatePickerIOSProps (#47145)

* [react-native] Added initialDate to DatePickerIOSProps

* [react-native] Make DatePickerIOSProps.date optional

See 0b9ea60b4f/Libraries/Components/DatePicker/DatePickerIOS.ios.js (L39)

* [react-native] Allow null on DatePickerIOSProps.date and .initialDate

See flow typings

* [react-native] Fixed whitespace error
This commit is contained in:
Danilo Bürger 2020-08-31 16:24:08 +02:00 committed by GitHub
parent 4f2ff6de9d
commit d59b2b61a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2942,7 +2942,17 @@ export interface DatePickerIOSProps extends ViewProps {
/**
* The currently selected date.
*/
date: Date;
date?: Date | null;
/**
* Provides an initial value that will change when the user starts selecting
* a date. It is useful for simple use-cases where you do not want to deal
* with listening to events and updating the date prop to keep the
* controlled state in sync. The controlled state has known bugs which
* causes it to go out of sync with native. The initialDate prop is intended
* to allow you to have native be source of truth.
*/
initialDate?: Date | null;
/**
* The date picker locale.